Kaynağa Gözat

Add fileName field to ListViewFile. Set codec for QString<->C string conversion to UTF-8.

git-svn-id: file:///var/svn/tigccpp/trunk@325 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 yıl önce
ebeveyn
işleme
a3e6164220
3 değiştirilmiş dosya ile 8 ekleme ve 2 silme
  1. 1 1
      ktigcc/KTIGCC.pws
  2. 5 0
      ktigcc/ktigcc.cpp
  3. 2 1
      ktigcc/mainform.ui.h

+ 1 - 1
ktigcc/KTIGCC.pws

@@ -7,7 +7,7 @@ clean before build=false
 
 [filenumbers]
 0=187
-1=715
+1=920
 2=27
 3=4
 

+ 5 - 0
ktigcc/ktigcc.cpp

@@ -24,6 +24,7 @@
 #include <kapplication.h>
 #include <kcmdlineargs.h>
 #include <kaboutdata.h>
+#include <qtextcodec.h>
 #include "mainform.h"
 using namespace std;
 void qCleanupImages_ktigcc();
@@ -36,6 +37,10 @@ KAboutData *pabout;
 
 int main( int argc, char *argv[] )
 {
+  // We're doing plenty of C string <-> QString conversions, let's make sure
+  // they're not lossy!
+  QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+
   KAboutData about("KTIGCC","TIGCC IDE for KDE","1.00",
   "TIGCC C and ASM SDK", KAboutData::License_GPL,
   "Copyright (C) 2004-2005 Kevin Kofler. All rights reserved.\n"

+ 2 - 1
ktigcc/mainform.ui.h

@@ -136,6 +136,7 @@ class ListViewFile : public QListViewItem {
   virtual int rtti(void) const {return 0x716CC1;}
   QString textBuffer;
   unsigned int cursorLine, cursorCol;
+  QString fileName; // full name of the file
   protected:
 };
 
@@ -927,7 +928,7 @@ void MainForm::updateRightStatusLabel()
       charsStatusLabel->hide();
       rightStatusLabel->setMaximumWidth(rightStatusSize);
     }
-    rightStatusLabel->setText("file name");
+    rightStatusLabel->setText(static_cast<ListViewFile *>(currentListItem)->fileName);
   }
 }