Bläddra i källkod

Run adapt-to-kde4-api.pl.

git-svn-id: file:///var/svn/tigccpp/trunk@942 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 17 år sedan
förälder
incheckning
4d567d0283

+ 11 - 11
ktigcc/completion.cpp

@@ -289,7 +289,7 @@ static QStringList prototypesForIdentifier(const QString &identifier,
           const KTextEditor::CompletionEntry &entry=*it;
           QString entryText=entry.text;
           unsigned entryTextLength=entryText.length();
-          unsigned minLength=QMIN(identifierLength,entryTextLength);
+          unsigned minLength=qMin(identifierLength,entryTextLength);
           unsigned i=0;
           for (; i<minLength && identifierUpper[i]==entryText[i].upper(); i++);
           unsigned distance=minLength-i;
@@ -331,7 +331,7 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
         return false;
       }
       if (hsf.endsWith(".ref")) {
-        QString realHeader=fileText.stripWhiteSpace();
+        QString realHeader=fileText.trimmed();
         QDir realHdrQdir(QFileInfo(qdir,realHeader).filePath());
         QString realHsf=hsf;
         realHsf.replace(realHsf.length()-3,3,"hsf");
@@ -373,11 +373,11 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
           definition=line.mid(11);
           definition.remove(comments);
           int pos=definition.find(entry.text);
-          QString left=(pos>=0)?definition.left(pos).stripWhiteSpace()
+          QString left=(pos>=0)?definition.left(pos).trimmed()
                                :QString::null;
           QString right;
           if (left.startsWith("typedef")) {
-            entry.postfix=left.mid(8).simplifyWhiteSpace();
+            entry.postfix=left.mid(8).simplified();
             left=QString::null;
           } else if (left=="unknown_retval") left="?";
           else if (left=="#define") left=QString::null;
@@ -385,7 +385,7 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
             left.prepend(' ');
             entry.prefix+=left;
           }
-          entry.postfix+=definition.mid(pos+entry.text.length()).simplifyWhiteSpace();
+          entry.postfix+=definition.mid(pos+entry.text.length()).simplified();
           break;
         }
       }
@@ -402,7 +402,7 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
             if (line=="Subtype=Enumeration") {
               int pos1=definition.find('{');
               if (pos1>=0) {
-                QString left=definition.left(pos1).stripWhiteSpace();
+                QString left=definition.left(pos1).trimmed();
                 int pos2=definition.find('}',++pos1);
                 if (pos2>=0) {
                   QString itemList=definition.mid(pos1,pos2-pos1);
@@ -414,7 +414,7 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
                         realDefinition.remove(comments);
                         pos1=realDefinition.find('{');
                         if (pos1>=0) {
-                          left=realDefinition.left(pos1).stripWhiteSpace();
+                          left=realDefinition.left(pos1).trimmed();
                           pos2=realDefinition.find('}',++pos1);
                           if (pos2>=0) {
                             itemList=realDefinition.mid(pos1,pos2-pos1);
@@ -433,9 +433,9 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
                       KTextEditor::CompletionEntry enumEntry;
                       int pos=enumItem.find('=');
                       if (pos>=0) {
-                        enumEntry.text=enumItem.left(pos).stripWhiteSpace();
-                        enumEntry.postfix=enumItem.mid(pos+1).stripWhiteSpace();
-                      } else enumEntry.text=enumItem.stripWhiteSpace();
+                        enumEntry.text=enumItem.left(pos).trimmed();
+                        enumEntry.postfix=enumItem.mid(pos+1).trimmed();
+                      } else enumEntry.text=enumItem.trimmed();
                       enumEntry.prefix=left;
                       enumEntry.comment=description;
                       entries.append(enumEntry);
@@ -448,7 +448,7 @@ bool parseHelpSources(QWidget *parent, const QString &directory,
           }
         }
       }
-      if (entry.text.stripWhiteSpace().isEmpty()) {
+      if (entry.text.trimmed().isEmpty()) {
         // No function name, so use HSF name. Can happen for _ROM_CALL_*.
         if (!hsf.startsWith("_ROM_CALL_"))
           KMessageBox::sorry(parent,QString("No name found in %1/%2").arg(header)

+ 3 - 3
ktigcc/ktigcc.cpp

@@ -88,11 +88,11 @@ int main(int argc, char *argv[])
   pabout=&about;
   KCmdLineArgs::init(argc,argv,&about);
   KCmdLineArgs::addCmdLineOptions(options);
-  KApplication::addCmdLineOptions();
+  KCmdLineArgs::addStdCmdLineOptions();
   KApplication app;
   // Set the preferred large icon size so system toolbar icons don't get
   // annoying padding.
-  int toolbarIconSize=KIconLoader().currentSize(KIcon::MainToolbar);
+  int toolbarIconSize=KIconLoader().currentSize(K3Icon::MainToolbar);
   QIcon::setIconSize(QIcon::Large,QSize(toolbarIconSize,toolbarIconSize));
   // Readd the images KDE kindly removes...
   qCleanupImages_ktigcc();
@@ -217,7 +217,7 @@ void clear_temp_dir(void)
 
 void force_qt_assistant_page(int n)
 {
-  QString fname=QDir::homeDirPath()+"/.qt/qt_assistantrc";
+  QString fname=QDir::homePath()+"/.qt/qt_assistantrc";
   FILE *f=fopen(fname,"r+b");
   if (!f) f=fopen(fname,"w+b");
   if (!f) exit(1);

+ 2 - 2
ktigcc/ktigcc.pro

@@ -105,8 +105,8 @@ isEmpty(KDEPREFIX):error(KDE 4 kdelibs required.)
 
 exists($$KDEPREFIX/include/kde4) {
   INCLUDEPATH += $$KDEPREFIX/include/kde4
-} else:exists($$KDEPREFIX/include/kde) {
-  INCLUDEPATH += $$KDEPREFIX/include/kde
+# } else:exists($$KDEPREFIX/include/kde) {
+#  INCLUDEPATH += $$KDEPREFIX/include/kde
 } else {
   INCLUDEPATH += $$KDEPREFIX/include
 }

+ 81 - 80
ktigcc/mainform.ui.h

@@ -167,8 +167,8 @@ enum {TIGCCOpenProjectFileFilter,TIGCCAddFilesFilter};
                                         othFileCount)
 #define CURRENT_VIEW (static_cast<Kate::View *>(widgetStack->visibleWidget()))
 
-#define LOAD_ICON(name) (QIcon(KGlobal::iconLoader()->loadIcon((name),KIcon::Small),KGlobal::iconLoader()->loadIcon((name),KIcon::MainToolbar)))
-#define SYSICON(sysname,name) (preferences.useSystemIcons?KGlobal::iconLoader()->loadIcon((sysname),KIcon::Small,KIcon::SizeSmall):qPixmapFromMimeSource((name)))
+#define LOAD_ICON(name) (QIcon(KIconLoader::global()->loadIcon((name),K3Icon::Small),KGlobal::iconLoader()->loadIcon((name),K3Icon::MainToolbar)))
+#define SYSICON(sysname,name) (preferences.useSystemIcons?KIconLoader::global()->loadIcon((sysname),K3Icon::Small,K3Icon::SizeSmall):qPixmapFromMimeSource((name)))
 
 #define SET_TEXT_SAFE(doc,text) do { \
     disableViewEvents=TRUE; \
@@ -242,29 +242,29 @@ static KReplaceWithSelection *kreplace;
 
 // All the methods are inline because otherwise QT Designer will mistake them
 // for slots of the main form.
-class ListViewFolder : public KListViewItem {
+class ListViewFolder : public K3ListViewItem {
   public:
-  ListViewFolder(Q3ListView *parent) : KListViewItem(parent)
+  ListViewFolder(Q3ListView *parent) : K3ListViewItem(parent)
   {
     setPixmap(0,SYSICON("folder","folder1.png"));
     setDragEnabled(TRUE);
     setDropEnabled(TRUE);
   }
-  ListViewFolder(Q3ListViewItem *parent) : KListViewItem(parent)
+  ListViewFolder(Q3ListViewItem *parent) : K3ListViewItem(parent)
   {
     setPixmap(0,SYSICON("folder","folder1.png"));
     setDragEnabled(TRUE);
     setDropEnabled(TRUE);
   }
   ListViewFolder(Q3ListView *parent, Q3ListViewItem *after)
-          : KListViewItem(parent, after)
+          : K3ListViewItem(parent, after)
   {
     setPixmap(0,SYSICON("folder","folder1.png"));
     setDropEnabled(TRUE);
     setDragEnabled(TRUE);
   }
   ListViewFolder(Q3ListViewItem *parent, Q3ListViewItem *after)
-          : KListViewItem(parent, after)
+          : K3ListViewItem(parent, after)
   {
     setPixmap(0,SYSICON("folder","folder1.png"));
     setDragEnabled(TRUE);
@@ -272,17 +272,17 @@ class ListViewFolder : public KListViewItem {
   }
   virtual int rtti(void) const {return 0x716CC0;}
   // Work around gratuitous API difference. Why do I have to do this? That's
-  // what startRename is a virtual method for. KListViewItem should do this.
+  // what startRename is a virtual method for. K3ListViewItem should do this.
   virtual void startRename(int col)
   {
-    static_cast<KListView *>(listView())->rename(this,col);
+    static_cast<K3ListView *>(listView())->rename(this,col);
   }
   protected:
 };
 
-class ListViewFile : public KListViewItem {
+class ListViewFile : public K3ListViewItem {
   public:
-  ListViewFile(Q3ListView *parent) : KListViewItem(parent),
+  ListViewFile(Q3ListView *parent) : K3ListViewItem(parent),
                                     kateView(NULL), isNew(TRUE),
                                     modifiedSinceLastCompile(TRUE)
   {
@@ -291,7 +291,7 @@ class ListViewFile : public KListViewItem {
     setDropEnabled(TRUE);
     setRenameEnabled(0,TRUE);
   }
-  ListViewFile(Q3ListViewItem *parent) : KListViewItem(parent),
+  ListViewFile(Q3ListViewItem *parent) : K3ListViewItem(parent),
                                         kateView(NULL), isNew(TRUE),
                                         modifiedSinceLastCompile(TRUE)
   {
@@ -301,7 +301,7 @@ class ListViewFile : public KListViewItem {
     setRenameEnabled(0,TRUE);
   }
   ListViewFile(Q3ListView *parent, Q3ListViewItem *after)
-          : KListViewItem(parent, after), kateView(NULL), isNew(TRUE),
+          : K3ListViewItem(parent, after), kateView(NULL), isNew(TRUE),
             modifiedSinceLastCompile(TRUE)
   {
     setPixmap(0,SYSICON("unknown","filex.png"));
@@ -310,7 +310,7 @@ class ListViewFile : public KListViewItem {
     setRenameEnabled(0,TRUE);
   }
   ListViewFile(Q3ListViewItem *parent, Q3ListViewItem *after)
-          : KListViewItem(parent, after), kateView(NULL),
+          : K3ListViewItem(parent, after), kateView(NULL),
             isNew(TRUE), modifiedSinceLastCompile(TRUE)
   {
     setPixmap(0,SYSICON("unknown","filex.png"));
@@ -341,47 +341,47 @@ class ListViewFile : public KListViewItem {
   bool modifiedSinceLastCompile;
   LineStartList lineStartList;
   // Work around gratuitous API difference. Why do I have to do this? That's
-  // what startRename is a virtual method for. KListViewItem should do this.
+  // what startRename is a virtual method for. K3ListViewItem should do this.
   virtual void startRename(int col)
   {
-    static_cast<KListView *>(listView())->rename(this,col);
+    static_cast<K3ListView *>(listView())->rename(this,col);
   }
   protected:
 };
 
-class ListViewRoot : public KListViewItem {
+class ListViewRoot : public K3ListViewItem {
   public:
-  ListViewRoot(Q3ListView *parent) : KListViewItem(parent)
+  ListViewRoot(Q3ListView *parent) : K3ListViewItem(parent)
   {
     setRenameEnabled(0,TRUE);
     // dragging not really allowed, but don't let the cursor run around when dragged
     setDragEnabled(TRUE);
   }
-  ListViewRoot(Q3ListViewItem *parent) : KListViewItem(parent)
+  ListViewRoot(Q3ListViewItem *parent) : K3ListViewItem(parent)
   {
     setRenameEnabled(0,TRUE);
     // dragging not really allowed, but don't let the cursor run around when dragged
     setDragEnabled(TRUE);
   }
   ListViewRoot(Q3ListView *parent, Q3ListViewItem *after)
-          : KListViewItem(parent, after)
+          : K3ListViewItem(parent, after)
   {
     setRenameEnabled(0,TRUE);
     // dragging not really allowed, but don't let the cursor run around when dragged
     setDragEnabled(TRUE);
   }
   ListViewRoot(Q3ListViewItem *parent, Q3ListViewItem *after)
-          : KListViewItem(parent, after)
+          : K3ListViewItem(parent, after)
   {
     setRenameEnabled(0,TRUE);
     // dragging not really allowed, but don't let the cursor run around when dragged
     setDragEnabled(TRUE);
   }
   // Work around gratuitous API difference. Why do I have to do this? That's
-  // what startRename is a virtual method for. KListViewItem should do this.
+  // what startRename is a virtual method for. K3ListViewItem should do this.
   virtual void startRename(int col)
   {
-    static_cast<KListView *>(listView())->rename(this,col);
+    static_cast<K3ListView *>(listView())->rename(this,col);
   }
   protected:
 };
@@ -431,13 +431,13 @@ Tools tools, tempTools;
 int toolIndex;
 bool disableViewEvents=FALSE;
 
-class DnDListView : public KListView {
+class DnDListView : public K3ListView {
   private:
   public:
   DnDListView ( QWidget * parent = 0, const char * name = 0)
-          : KListView(parent,name) {}
+          : K3ListView(parent,name) {}
   // Make my hand-coded drag&drop code work (public part).
-  // Maybe the built-in drag&drop support in KListView could be made to work as
+  // Maybe the built-in drag&drop support in K3ListView could be made to work as
   // expected, but for now just bypass it to use the existing code I wrote for
   // QListView.
   virtual void takeItem(Q3ListViewItem *i) {Q3ListView::takeItem(i);}
@@ -684,27 +684,27 @@ class DnDListView : public KListView {
   virtual void startDrag() {
     Q3ListView::startDrag();
   }
-  // KListView::rename won't work properly if I don't do this. :-/
+  // K3ListView::rename won't work properly if I don't do this. :-/
   virtual void rename(Q3ListViewItem *item, int c) {
     QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput,1000);
     ensureItemVisible(item);
     QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput,1000);
-    KListView::rename(item,c);
+    K3ListView::rename(item,c);
   }
 };
 
 enum ErrorTypes {etError, etWarning, etInfo};
-class ErrorListItem : public KListViewItem {
+class ErrorListItem : public K3ListViewItem {
   public:
   ErrorListItem(MainForm *pMainForm, ErrorTypes errType,
                 const QString &errFile, const QString &errFunc,
                 const QString &errMsg, unsigned errLine, unsigned errColumn)
-    : KListViewItem(errorList->errorListView,
+    : K3ListViewItem(errorList->errorListView,
                     errorList->errorListView->lastItem()),
       lvFile(0), srcFile(0), cursor(0), errorLine((unsigned)-1), errorColumn(0),
       mainForm(pMainForm), errorType(errType)
   {
-    QString errMessage=errMsg.stripWhiteSpace();
+    QString errMessage=errMsg.trimmed();
     if (!errMessage.isEmpty()) errMessage[0]=errMessage[0].upper();
     switch(errType) {
       case etError:
@@ -1067,7 +1067,7 @@ void MainForm::init()
   khelpmenu=new KHelpMenu(this,pabout);
   assistant=new AssistantClient(this,
     QString("%1/doc/html/qt-assistant.adp").arg(tigcc_base));
-  lastDirectory=QString("%1/tigcc-projects").arg(QDir::homeDirPath());
+  lastDirectory=QString("%1/tigcc-projects").arg(QDir::homePath());
   if (!QDir(lastDirectory).exists() && !QDir().mkdir(lastDirectory))
     lastDirectory=QString("%1/projects").arg(tigcc_base);
   projectFileName="";
@@ -1141,11 +1141,11 @@ void MainForm::init()
     helpDocumentationAction->setIconSet(LOAD_ICON("help"));
     helpSearchAction->setIconSet(LOAD_ICON("filefind"));
     findFindAction->setIconSet(LOAD_ICON("filefind"));
-    if (KGlobal::iconLoader()->iconPath("stock-find-and-replace",KIcon::Small,TRUE).isEmpty()) {
+    if (KIconLoader::global()->iconPath("stock-find-and-replace",K3Icon::Small,TRUE).isEmpty()) {
       QIcon fileReplaceIconSet(qPixmapFromMimeSource("filereplace.png"));
-      int smallSize=IconSize(KIcon::Small);
+      int smallSize=IconSize(K3Icon::Small);
       fileReplaceIconSet.setIconSize(QIcon::Small,QSize(smallSize,smallSize));
-      int largeSize=IconSize(KIcon::MainToolbar);
+      int largeSize=IconSize(K3Icon::MainToolbar);
       fileReplaceIconSet.setIconSize(QIcon::Large,QSize(largeSize,largeSize));
       findReplaceAction->setIconSet(fileReplaceIconSet);
     } else
@@ -1204,7 +1204,7 @@ void MainForm::init()
   }
   pconfig->setGroup("Recent files");
   if (parg) {
-    QString fileName=QDir().absFilePath(parg);
+    QString fileName=QDir().absoluteFilePath(parg);
     if (!openProject(fileName)) goto openRecent;
   } else {
     openRecent:;
@@ -1532,7 +1532,7 @@ QString MainForm::SGetFileName(int mode,const QString &fileFilter,const QString
     ret=KFileDialog::getSaveFileName(lastDirectory,fileFilter,parent,caption);
   if (!ret.isNull())
   {
-    KURL dir;
+    KUrl dir;
     dir.setPath(ret);
     dir.setFileName("");
     lastDirectory=dir.path();
@@ -1547,7 +1547,7 @@ QStringList MainForm::SGetFileName_Multiple(const QString &fileFilter,const QStr
   ret=KFileDialog::getOpenFileNames(lastDirectory,fileFilter,parent,caption);
   if (!ret.empty())
   {
-    KURL dir;
+    KUrl dir;
     dir.setPath(ret[0]);
     dir.setFileName("");
     lastDirectory=dir.path();
@@ -1864,7 +1864,7 @@ void MainForm::fileOpen_addList(Q3ListViewItem *category,void *fileListV,void *d
 {
   int i,e;
   int p,pslash;
-  KURL tmp;
+  KUrl tmp;
   TPRFileList *fileList=(TPRFileList*)fileListV;
   QString caption;
   QString treePath;
@@ -1873,7 +1873,7 @@ void MainForm::fileOpen_addList(Q3ListViewItem *category,void *fileListV,void *d
   if (e) category->setOpen(TRUE);
   for (i=0;i<e;i++)
   {
-    tmp=*reinterpret_cast<const KURL *>(dir);
+    tmp=*reinterpret_cast<const KUrl *>(dir);
     kurlNewFileName(tmp,fileList->path[i]);
     caption=fileList->path[i];
     //fixed suffix truncation for file paths such as "/root/.dot/nodot" so it wouldn't truncate to "/root/"
@@ -1881,7 +1881,7 @@ void MainForm::fileOpen_addList(Q3ListViewItem *category,void *fileListV,void *d
     pslash=caption.findRev('/');
     if (p>=0&&p>pslash) caption.truncate(p);
     if (pslash>=0) caption.remove(0,pslash+1);
-    treePath=fileList->folder[i].stripWhiteSpace();
+    treePath=fileList->folder[i].trimmed();
     //check for a backslash at the end and remove it if it's there.
     if (treePath[treePath.length()-1]=='\\')
       treePath.truncate(treePath.length()-1);
@@ -1907,7 +1907,7 @@ void MainForm::fileOpen_addList(Q3ListViewItem *category,void *fileListV,void *d
 bool MainForm::openProject(const QString &fileName)
 {
   TPRDataStruct TPRData;
-  KURL dir;
+  KUrl dir;
   bool isProject=fileName.endsWith(".tpr",FALSE);
   dir.setPath(fileName);
   switch (getPathType(fileName)) {
@@ -2044,7 +2044,7 @@ void MainForm::fileOpen()
   if (compiling || savePrompt())
     return;
   QString fileName=SGetFileName(KFileDialog::Opening,findFilter(TIGCCOpenProjectFileFilter),"Open Project/File",this);
-  KURL dir;
+  KUrl dir;
   dir.setPath(fileName);
   if (fileName.isEmpty())
     return;
@@ -2085,7 +2085,7 @@ int MainForm::fileSavePrompt(Q3ListViewItem *fileItem)
   ListViewFile *theFile=static_cast<ListViewFile *>(fileItem);
   if (!theFile->kateView) return 0;
   while (theFile->kateView->getDoc()->isModified()) { // "while" in case saving fails!
-    result=KMessageBox::questionYesNoCancel(this,QString("The file \'%1\' has been modified.  Do you want to save the changes?").arg(theFile->text(0)),QString::null,KStdGuiItem::save(),KStdGuiItem::discard());
+    result=KMessageBox::questionYesNoCancel(this,QString("The file \'%1\' has been modified.  Do you want to save the changes?").arg(theFile->text(0)),QString::null,KStandardGuiItem::save(),KStandardGuiItem::discard());
     if (result==KMessageBox::Yes)
       fileSave_save(fileItem);
     else if (result==KMessageBox::No)
@@ -2102,7 +2102,7 @@ int MainForm::savePrompt(void)
   int result;
   
   while (projectIsDirty) {
-    result=KMessageBox::questionYesNoCancel(this,"The current project has been modified.  Do you want to save the changes?",QString::null,KStdGuiItem::save(),KStdGuiItem::discard());
+    result=KMessageBox::questionYesNoCancel(this,"The current project has been modified.  Do you want to save the changes?",QString::null,KStandardGuiItem::save(),KStandardGuiItem::discard());
     if (result==KMessageBox::Yes)
       fileSave();
     else if (result==KMessageBox::No)
@@ -2263,8 +2263,8 @@ void MainForm::fileSave_loadList(Q3ListViewItem *category,void *fileListV,const
   if (!category)
     return;
   TPRFileList *fileList=(TPRFileList*)fileListV;
-  KURL *new_dir=(KURL*)dir_new;
-  KURL tmpPath;
+  KUrl *new_dir=(KUrl*)dir_new;
+  KUrl tmpPath;
   Q3ListViewItem *item=category->firstChild();
   Q3ListViewItem *next;
   QString folderSpec=QString::null;
@@ -2275,7 +2275,7 @@ void MainForm::fileSave_loadList(Q3ListViewItem *category,void *fileListV,const
     {
       ListViewFile *theFile=static_cast<ListViewFile *>(item);
       QString absPath=theFile->fileName;
-      QString relPath=KURL::relativePath(base_dir,absPath);
+      QString relPath=KUrl::relativePath(base_dir,absPath);
       if (relPath.startsWith("./"))
       {
         relPath=relPath.mid(2);
@@ -2376,10 +2376,10 @@ void MainForm::fileSave_fromto(const QString &lastProj,const QString &nextProj)
 {
   TPRDataStruct TPRData;
   QString open_file;
-  KURL base_dir_k(lastProj);
+  KUrl base_dir_k(lastProj);
   base_dir_k.setFileName("");
   QString base_dir=base_dir_k.path();
-  KURL new_dir(nextProj);
+  KUrl new_dir(nextProj);
   
   fileSave_loadList(hFilesListItem,&TPRData.h_files,base_dir,&new_dir,&open_file);
   fileSave_loadList(cFilesListItem,&TPRData.c_files,base_dir,&new_dir,&open_file);
@@ -2559,11 +2559,11 @@ void MainForm::filePreferences()
       helpDocumentationAction->setIconSet(LOAD_ICON("help"));
       helpSearchAction->setIconSet(LOAD_ICON("filefind"));
       findFindAction->setIconSet(LOAD_ICON("filefind"));
-      if (KGlobal::iconLoader()->iconPath("stock-find-and-replace",KIcon::Small,TRUE).isEmpty()) {
+      if (KIconLoader::global()->iconPath("stock-find-and-replace",K3Icon::Small,TRUE).isEmpty()) {
         QIcon fileReplaceIconSet(qPixmapFromMimeSource("filereplace.png"));
-        int smallSize=IconSize(KIcon::Small);
+        int smallSize=IconSize(K3Icon::Small);
         fileReplaceIconSet.setIconSize(QIcon::Small,QSize(smallSize,smallSize));
-        int largeSize=IconSize(KIcon::MainToolbar);
+        int largeSize=IconSize(K3Icon::MainToolbar);
         fileReplaceIconSet.setIconSize(QIcon::Large,QSize(largeSize,largeSize));
         findReplaceAction->setIconSet(fileReplaceIconSet);
       } else
@@ -2706,7 +2706,7 @@ void MainForm::findFind()
   else {
     // Never set hasSelection because finding in selection doesn't really make
     // sense with my non-modal find dialog setup.
-    kfinddialog=new KFindDialog(false,this,0,KFindDialog::FromCursor,findHistory);
+    kfinddialog=new KFindDialog(false,this,0,KFind::FromCursor,findHistory);
     connect(kfinddialog, SIGNAL(okClicked()), this, SLOT(findFind_next()));
     connect(kfinddialog, SIGNAL(cancelClicked()), this, SLOT(findFind_stop()));
     kfinddialog->show();
@@ -2720,7 +2720,7 @@ void MainForm::findFind_next()
   KFind *kfind=new KFind(kfinddialog->pattern(),kfinddialog->options(),this,kfinddialog);
 
   // Initialize.
-  bool findBackwards=!!(kfinddialog->options()&KFindDialog::FindBackwards);
+  bool findBackwards=!!(kfinddialog->options()&KFind::FindBackwards);
   int findCurrentCol;
   kfind=new KFind(kfinddialog->pattern(),kfinddialog->options(),this,kfinddialog);
   kfind->closeFindNextDialog(); // don't use this, a non-modal KFindDialog is used instead
@@ -2730,7 +2730,7 @@ void MainForm::findFind_next()
   if (!currentListItem) fileTreeClicked(rootListItem);
   findCurrentDocument=currentListItem;
   if (CURRENT_VIEW) {
-    if (kfinddialog->options()&KFindDialog::FromCursor) {
+    if (kfinddialog->options()&KFind::FromCursor) {
       if (CURRENT_VIEW->getDoc()->hasSelection()) {
         if (findBackwards) {
           findCurrentLine=CURRENT_VIEW->getDoc()->selStartLine();
@@ -2905,7 +2905,7 @@ void MainForm::findReplace()
   }
   KReplaceDialog kreplacedialog(this,0,((CURRENT_VIEW&&CURRENT_VIEW->getDoc()->hasSelection()
                                         &&CURRENT_VIEW->getDoc()->selStartLine()!=CURRENT_VIEW->getDoc()->selEndLine())?
-                                        KFindDialog::SelectedText:0)|KFindDialog::FromCursor,
+                                        KFind::SelectedText:0)|KFind::FromCursor,
                                        findHistory,replacementHistory,
                                        CURRENT_VIEW&&CURRENT_VIEW->getDoc()->hasSelection());
   if (kreplacedialog.exec()!=QDialog::Accepted)
@@ -2926,13 +2926,13 @@ void MainForm::findReplace()
   // Connect dialogClosed signal - called when closing the Replace Next dialog.
   connect(kreplace,SIGNAL(dialogClosed()),this,SLOT(findReplace_stop()));
   // Initialize.
-  bool findBackwards=!!(kreplace->options()&KFindDialog::FindBackwards);
+  bool findBackwards=!!(kreplace->options()&KFind::FindBackwards);
   int replaceCurrentCol;
   // Make sure we have a valid currentListItem.
   if (!currentListItem) fileTreeClicked(rootListItem);
   replaceCurrentDocument=currentListItem;
   if (CURRENT_VIEW) {
-    if (kreplace->options()&KFindDialog::SelectedText) {
+    if (kreplace->options()&KFind::SelectedText) {
       kreplace->setSelection(CURRENT_VIEW->getDoc()->selStartLine(),
                              CURRENT_VIEW->getDoc()->selStartCol(),
                              CURRENT_VIEW->getDoc()->selEndLine(),
@@ -2944,8 +2944,8 @@ void MainForm::findReplace()
         replaceCurrentLine=kreplace->selStartLine();
         replaceCurrentCol=kreplace->selStartCol();
       }
-      kreplace->setOptions(kreplace->options()&~KFindDialog::FromCursor);
-    } else if (kreplace->options()&KFindDialog::FromCursor) {
+      kreplace->setOptions(kreplace->options()&~KFind::FromCursor);
+    } else if (kreplace->options()&KFind::FromCursor) {
       if (CURRENT_VIEW->getDoc()->hasSelection()) {
         if (findBackwards) {
           replaceCurrentLine=CURRENT_VIEW->getDoc()->selStartLine();
@@ -2965,7 +2965,7 @@ void MainForm::findReplace()
         if (findBackwards?(replaceCurrentLine==(CURRENT_VIEW->getDoc()->numLines()-1)
                            && replaceCurrentCol==(CURRENT_VIEW->getDoc()->lineLength(replaceCurrentLine)))
                          :(!replaceCurrentLine&&!replaceCurrentCol))
-          kreplace->setOptions(kreplace->options()&~KFindDialog::FromCursor);
+          kreplace->setOptions(kreplace->options()&~KFind::FromCursor);
       }
     } else {
       replaceCurrentLine=findBackwards?(CURRENT_VIEW->getDoc()->numLines()-1):0;
@@ -2989,7 +2989,7 @@ void MainForm::findReplace_next(bool firstTime)
   // Replace All only works on the current file. Also, if we have a selection,
   // we only want to work on the file containing the selection.
   bool global=(kreplace->options()&KReplaceDialog::PromptOnReplace)&&!kreplace->haveSelection();
-  bool findBackwards=!!(kreplace->options()&KFindDialog::FindBackwards);
+  bool findBackwards=!!(kreplace->options()&KFind::FindBackwards);
 
   // Reinitialize.
   if (!firstTime) {
@@ -3146,8 +3146,8 @@ void MainForm::findReplace_next(bool firstTime)
           if (CURRENT_VIEW) {
             if (kreplace->shouldRestart()) {
               // Drop "From cursor" and "Selected text" options.
-              kreplace->setOptions(kreplace->options()&~(KFindDialog::FromCursor
-                                                         |KFindDialog::SelectedText));
+              kreplace->setOptions(kreplace->options()&~(KFind::FromCursor
+                                                         |KFind::SelectedText));
               kreplace->invalidateSelection();
               // Reinitialize.
               replaceCurrentLine=findBackwards?(CURRENT_VIEW->getDoc()->numLines()-1):0;
@@ -3796,7 +3796,7 @@ void MainForm::procio_readReady()
     // calculator charset, so the variable name won't display properly if it
     // contains non-ASCII characters. Fix that up.
     if (ldTigccStatPhase==1
-        && line.stripWhiteSpace().startsWith("Program Variable Name:",FALSE)) {
+        && line.trimmed().startsWith("Program Variable Name:",FALSE)) {
       int pos=line.find(':');
       while (line[++pos]==' ');
       line.truncate(pos);
@@ -3837,7 +3837,7 @@ void MainForm::procio_readReady()
               if (line.contains("Fatal errors - assembly aborted",FALSE)) break;
               // Not an A68k error, so parse it as a standard *nix-style error.
               // Normalize characters and strip whitespace
-              line=line.stripWhiteSpace();
+              line=line.trimmed();
               line.replace('`','\''); // backtick
               line.replace(QChar(0xb4),'\''); // forward apostrophe
               line.replace('\"','\''); // quote
@@ -3894,15 +3894,15 @@ void MainForm::procio_readReady()
                         }
                       }
                     }
-                    errorMessage=errorMessage.stripWhiteSpace();
+                    errorMessage=errorMessage.trimmed();
                     ErrorTypes errorType=etError;
                     if (errorMessage.startsWith("warning:",FALSE)) {
                       errorMessage.remove(0,8);
-                      errorMessage=errorMessage.stripWhiteSpace();
+                      errorMessage=errorMessage.trimmed();
                       errorType=etWarning;
                     } else if (errorMessage.startsWith("error:",FALSE)) {
                       errorMessage.remove(0,6);
-                      errorMessage=errorMessage.stripWhiteSpace();
+                      errorMessage=errorMessage.trimmed();
                     }
                     if (errorMessage.startsWith("#warning ",FALSE)) {
                       errorMessage.remove(0,9);
@@ -3935,11 +3935,11 @@ void MainForm::procio_readReady()
                       ErrorTypes errorType=etError;
                       if (errorMessage.startsWith("warning:",FALSE)) {
                         errorMessage.remove(0,8);
-                        errorMessage=errorMessage.stripWhiteSpace();
+                        errorMessage=errorMessage.trimmed();
                         errorType=etWarning;
                       } else if (errorMessage.startsWith("error:",FALSE)) {
                         errorMessage.remove(0,6);
-                        errorMessage=errorMessage.stripWhiteSpace();
+                        errorMessage=errorMessage.trimmed();
                       }
                       if (!errorMessage.endsWith("."))
                         errorMessage.append('.');
@@ -3970,7 +3970,7 @@ void MainForm::procio_readReady()
         }
         break;
       case 1:
-        line=line.stripWhiteSpace();
+        line=line.trimmed();
         // Collect targets (the data file renaming needs to know them).
         if (line=="TI-89") ti89_targeted=TRUE;
         else if (line=="TI-92 Plus") ti92p_targeted=TRUE;
@@ -3981,9 +3981,9 @@ void MainForm::procio_readReady()
           ldTigccStatPhase=2;
         break;
       case 2:
-        compileStats.append(line.simplifyWhiteSpace());
+        compileStats.append(line.simplified());
         compileStats.append('\n');
-        if (line.stripWhiteSpace().startsWith("Data Variable Size:",FALSE))
+        if (line.trimmed().startsWith("Data Variable Size:",FALSE))
           dataFileGenerated=TRUE;
         break;
     }
@@ -4643,12 +4643,12 @@ void MainForm::showStats()
   // QStyleSheet::convertFromPlainText. Sadly, that replaces the spaces with
   // strange non-BMP characters (from a Private Use Area) which don't display
   // properly in KMessageBox, so fix up those surrogate pairs.
-  if (KMessageBox::questionYesNo(this,Q3StyleSheet::convertFromPlainText(
+  if (KMessageBox::questionYesNo(this,Qt::convertFromPlainText(
         QString("The project has been compiled successfully.\n\n%1\n"
         "Do you want to open the project folder?").arg(compileStats))
         .replace(QString(QChar(56319))+QString(QChar(56992))," "),
         "Compilation Successful")==KMessageBox::Yes) {
-    KURL projectDir=KURL::fromPathOrURL(projectFileName);
+    KUrl projectDir=KUrl::fromPathOrUrl(projectFileName);
     projectDir.setFileName("");
     KRun::runURL(projectDir.url(),"inode/directory");
   }
@@ -5030,7 +5030,7 @@ void MainForm::debugRun()
         {
           int err;
           // Convert the command to the calculator charset.
-          char *ti=ticonv_charset_utf16_to_ti(CALC_TI89,command.ucs2());
+          char *ti=ticonv_charset_utf16_to_ti(CALC_TI89,command.utf16());
           // Send it character by character.
           #define SEND_CHAR(c) \
             if ((err=ticalcs_calc_send_key(calc,(c)))) { \
@@ -5632,7 +5632,7 @@ void MainForm::newFile(Q3ListViewItem *parent, QString text, const QPixmap &pixm
   QString tmp,oldtmp,suffix,caption;
   QStringList allFiles=extractAllFileNames();
   Q3ListViewItem *category;
-  KURL tmpK;
+  KUrl tmpK;
   int tryNum;
   for (; IS_FILE(next); next=item->nextSibling())
     item=next;
@@ -5782,6 +5782,7 @@ void MainForm::newFile( Q3ListViewItem *parent )
                  "\t 0b0000000000000000, \\\n"
                  "\t 0b0000000000000000, \\\n"
                  "\t 0b0000000000000000}\n\n#include <tigcclib.h>\n\n"
+#include <QTextDocument>
                  "// Main Function\nvoid _main(void)\n{\n"
                  "\t// Place your code here.\n}\n"):"")),
                  category==cFilesListItem||category==qllFilesListItem
@@ -6301,4 +6302,4 @@ QString MainForm::textForHeader(const QString &fileName)
 }
 
 // Yes, this is an ugly hack... Any better suggestions?
-#define KListView DnDListView
+#define K3ListView DnDListView

+ 2 - 2
ktigcc/newsdlg.ui.h

@@ -83,7 +83,7 @@ bool NewsDialog::loadNews()
   QDate latestHeadline=pconfig->readDateTimeEntry("Latest Headline",
                                                   &defaultDateTime).date();
   if(KIO::NetAccess::download(
-      KURL("http://tigcc.ticalc.org/linux/newsheadlines.txt"),tmpFile,this)) {
+      KUrl("http://tigcc.ticalc.org/linux/newsheadlines.txt"),tmpFile,this)) {
     #define ERROR(s) do {KMessageBox::error(this,(s)); goto done;} while(0)
     #define ZAP_LF() do {char *p=line+(std::strlen(line)-1); if (*p=='\n') *p=0;} while(0)
     #define ZAP_CR() do {char *p=line+(std::strlen(line)-1); if (*p=='\r') *p=0;} while(0)
@@ -154,5 +154,5 @@ void NewsDialog::refreshButton_clicked()
 
 void NewsDialog::visitButton_clicked()
 {
-  KRun::runURL(KURL("http://tigcc.ticalc.org/linux/"),"text/html");
+  KRun::runURL(KUrl("http://tigcc.ticalc.org/linux/"),"text/html");
 }

+ 3 - 3
ktigcc/parsing.cpp

@@ -129,9 +129,9 @@ CompletionInfo parseFileCompletion(const QString &fileText,
   for (QStringList::ConstIterator it=lines.begin(); it!=lines.end(); ++it) {
     const QString &line=(*it);
     if (!inComment) {
-      QString strippedLine=line.stripWhiteSpace();
+      QString strippedLine=line.trimmed();
       if (strippedLine.startsWith("#include")) {
-        QString includedName=strippedLine.mid(8).stripWhiteSpace();
+        QString includedName=strippedLine.mid(8).trimmed();
         if (includedName[0]=='<') {
           int pos=includedName.find('>',1);
           if (pos>=0)
@@ -143,7 +143,7 @@ CompletionInfo parseFileCompletion(const QString &fileText,
               // A system header can only include another system header.
               result.includedSystem.append(includedName.mid(1,pos-1));
             else
-              result.included.append(QDir::cleanDirPath(pathInProject+"/"
+              result.included.append(QDir::cleanPath(pathInProject+"/"
                                                         +includedName.mid(1,pos-1)));
           }
         } // else ignore

+ 2 - 2
ktigcc/preferences.cpp

@@ -416,7 +416,7 @@ static void writeSyntaxXML(const Syn_SettingsForDoc &synprefs,
 
   // Write it to disk.
   QString xmlFileName=QString("%1/.kde/share/apps/katepart/syntax/ktigcc%2.xml")
-                      .arg(QDir::homeDirPath()).arg(internalName);
+                      .arg(QDir::homePath()).arg(internalName);
   mkdir_multi(xmlFileName);
   std::FILE *f=std::fopen(xmlFileName,"w");
   if (f) {
@@ -458,7 +458,7 @@ static bool isNewerVersion(const QString &version1, const QString &version2)
 static bool checkSynHighlightVersion(const QString &internalName)
 {
   QString xmlFileName=QString("%1/.kde/share/apps/katepart/syntax/ktigcc%2.xml")
-                      .arg(QDir::homeDirPath()).arg(internalName);
+                      .arg(QDir::homePath()).arg(internalName);
   QDomDocument doc("language");
   QFile file(xmlFileName);
   if (!file.open(QIODevice::ReadOnly))

+ 7 - 7
ktigcc/preferencesdlg.ui.h

@@ -45,7 +45,7 @@
 #include <kfontdialog.h>
 #include <kcolordialog.h>
 #include <kcombobox.h>
-#include <klistview.h>
+#include <k3listview.h>
 #include <klineedit.h>
 #include <keditlistbox.h>
 #include <klistbox.h>
@@ -68,29 +68,29 @@ class KRecentDirs {
     static void add(const QString &fileClass, const QString &directory);
 };
 
-class RenamableKListViewItem : public KListViewItem {
+class RenamableKListViewItem : public K3ListViewItem {
   public:
   RenamableKListViewItem(Q3ListViewItem *parent, QString text)
-    : KListViewItem(parent, text)
+    : K3ListViewItem(parent, text)
   {
     setRenameEnabled(0,TRUE);
   }
   RenamableKListViewItem(Q3ListViewItem *parent, Q3ListViewItem *after,
                          QString text)
-    : KListViewItem(parent, after, text)
+    : K3ListViewItem(parent, after, text)
   {
     setRenameEnabled(0,TRUE);
   }
   virtual int rtti(void) const {return 0x716CC8;}
   // Work around gratuitous API difference. Why do I have to do this? That's
-  // what startRename is a virtual method for. KListViewItem should do this.
+  // what startRename is a virtual method for. K3ListViewItem should do this.
   virtual void startRename(int col)
   {
-    // KListView::rename won't work properly if I don't do this. :-/
+    // K3ListView::rename won't work properly if I don't do this. :-/
     QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput,1000);
     listView()->ensureItemVisible(this);
     QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput,1000);
-    static_cast<KListView *>(listView())->rename(this,col);
+    static_cast<K3ListView *>(listView())->rename(this,col);
   }
 };
 

+ 21 - 21
ktigcc/srcfilewin.ui.h

@@ -101,8 +101,8 @@ enum {TIGCCOpenProjectFileFilter,TIGCCAddFilesFilter};
 #define CURRENT_VIEW (THIS->kateView)
 #define HL_MODE ((THIS->hlEnabled && *(THIS->hlEnabled))?THIS->hlMode:"None")
 
-#define LOAD_ICON(name) (QIcon(KGlobal::iconLoader()->loadIcon((name),KIcon::Small),KGlobal::iconLoader()->loadIcon((name),KIcon::MainToolbar)))
-#define SYSICON(sysname,name) (preferences.useSystemIcons?KGlobal::iconLoader()->loadIcon((sysname),KIcon::Small):qPixmapFromMimeSource((name)))
+#define LOAD_ICON(name) (QIcon(KIconLoader::global()->loadIcon((name),K3Icon::Small),KGlobal::iconLoader()->loadIcon((name),K3Icon::MainToolbar)))
+#define SYSICON(sysname,name) (preferences.useSystemIcons?KIconLoader::global()->loadIcon((sysname),K3Icon::Small):qPixmapFromMimeSource((name)))
 
 #define SET_TEXT_SAFE(doc,text) do { \
     disableViewEvents=TRUE; \
@@ -257,11 +257,11 @@ void SourceFileWindow::initBase()
     editCopyAction->setIconSet(LOAD_ICON("editcopy"));
     editPasteAction->setIconSet(LOAD_ICON("editpaste"));
     findFindAction->setIconSet(LOAD_ICON("filefind"));
-    if (KGlobal::iconLoader()->iconPath("stock-find-and-replace",KIcon::Small,TRUE).isEmpty()) {
+    if (KIconLoader::global()->iconPath("stock-find-and-replace",K3Icon::Small,TRUE).isEmpty()) {
       QIcon fileReplaceIconSet(qPixmapFromMimeSource("filereplace.png"));
-      int smallSize=IconSize(KIcon::Small);
+      int smallSize=IconSize(K3Icon::Small);
       fileReplaceIconSet.setIconSize(QIcon::Small,QSize(smallSize,smallSize));
-      int largeSize=IconSize(KIcon::MainToolbar);
+      int largeSize=IconSize(K3Icon::MainToolbar);
       fileReplaceIconSet.setIconSize(QIcon::Large,QSize(largeSize,largeSize));
       findReplaceAction->setIconSet(fileReplaceIconSet);
     } else
@@ -445,7 +445,7 @@ int SourceFileWindow::savePrompt(void)
   int result;
   if (!CURRENT_VIEW) return 0;
   while (CURRENT_VIEW->getDoc()->isModified()) { // "while" in case saving fails!
-    result=KMessageBox::questionYesNoCancel(this,QString("The file \'%1\' has been modified.  Do you want to save the changes?").arg(THIS->fileName),QString::null,KStdGuiItem::save(),KStdGuiItem::discard());
+    result=KMessageBox::questionYesNoCancel(this,QString("The file \'%1\' has been modified.  Do you want to save the changes?").arg(THIS->fileName),QString::null,KStandardGuiItem::save(),KStandardGuiItem::discard());
     if (result==KMessageBox::Yes)
       fileSave();
     else if (result==KMessageBox::No)
@@ -600,11 +600,11 @@ void SourceFileWindow::applyPreferences()
     editCopyAction->setIconSet(LOAD_ICON("editcopy"));
     editPasteAction->setIconSet(LOAD_ICON("editpaste"));
     findFindAction->setIconSet(LOAD_ICON("filefind"));
-    if (KGlobal::iconLoader()->iconPath("stock-find-and-replace",KIcon::Small,TRUE).isEmpty()) {
+    if (KIconLoader::global()->iconPath("stock-find-and-replace",K3Icon::Small,TRUE).isEmpty()) {
       QIcon fileReplaceIconSet(qPixmapFromMimeSource("filereplace.png"));
-      int smallSize=IconSize(KIcon::Small);
+      int smallSize=IconSize(K3Icon::Small);
       fileReplaceIconSet.setIconSize(QIcon::Small,QSize(smallSize,smallSize));
-      int largeSize=IconSize(KIcon::MainToolbar);
+      int largeSize=IconSize(K3Icon::MainToolbar);
       fileReplaceIconSet.setIconSize(QIcon::Large,QSize(largeSize,largeSize));
       findReplaceAction->setIconSet(fileReplaceIconSet);
     } else
@@ -695,7 +695,7 @@ void SourceFileWindow::findFind()
   else {
     // Never set hasSelection because finding in selection doesn't really make
     // sense with my non-modal find dialog setup.
-    THIS->kfinddialog=new KFindDialog(false,this,0,KFindDialog::FromCursor,findHistory);
+    THIS->kfinddialog=new KFindDialog(false,this,0,KFind::FromCursor,findHistory);
     connect(THIS->kfinddialog, SIGNAL(okClicked()), this, SLOT(findFind_next()));
     connect(THIS->kfinddialog, SIGNAL(cancelClicked()), this, SLOT(findFind_stop()));
     THIS->kfinddialog->show();
@@ -709,13 +709,13 @@ void SourceFileWindow::findFind_next()
   KFind *kfind=new KFind(THIS->kfinddialog->pattern(),THIS->kfinddialog->options(),this,THIS->kfinddialog);
 
   // Initialize.
-  bool findBackwards=!!(THIS->kfinddialog->options()&KFindDialog::FindBackwards);
+  bool findBackwards=!!(THIS->kfinddialog->options()&KFind::FindBackwards);
   int findCurrentCol;
   kfind=new KFind(THIS->kfinddialog->pattern(),THIS->kfinddialog->options(),this,THIS->kfinddialog);
   kfind->closeFindNextDialog(); // don't use this, a non-modal KFindDialog is used instead
   connect(kfind,SIGNAL(highlight(const QString &,int,int)),
           this,SLOT(findFind_highlight(const QString &,int,int)));
-  if (THIS->kfinddialog->options()&KFindDialog::FromCursor) {
+  if (THIS->kfinddialog->options()&KFind::FromCursor) {
     if (CURRENT_VIEW->getDoc()->hasSelection()) {
       if (findBackwards) {
         THIS->findCurrentLine=CURRENT_VIEW->getDoc()->selStartLine();
@@ -798,7 +798,7 @@ void SourceFileWindow::findReplace()
   }
   KReplaceDialog kreplacedialog(this,0,((CURRENT_VIEW&&CURRENT_VIEW->getDoc()->hasSelection()
                                         &&CURRENT_VIEW->getDoc()->selStartLine()!=CURRENT_VIEW->getDoc()->selEndLine())?
-                                        KFindDialog::SelectedText:0)|KFindDialog::FromCursor,
+                                        KFind::SelectedText:0)|KFind::FromCursor,
                                        findHistory,replacementHistory,
                                        CURRENT_VIEW&&CURRENT_VIEW->getDoc()->hasSelection());
   if (kreplacedialog.exec()!=QDialog::Accepted)
@@ -819,10 +819,10 @@ void SourceFileWindow::findReplace()
   // Connect dialogClosed signal - called when closing the Replace Next dialog.
   connect(THIS->kreplace,SIGNAL(dialogClosed()),this,SLOT(findReplace_stop()));
   // Initialize.
-  bool findBackwards=!!(THIS->kreplace->options()&KFindDialog::FindBackwards);
+  bool findBackwards=!!(THIS->kreplace->options()&KFind::FindBackwards);
   int replaceCurrentCol;
   if (CURRENT_VIEW) {
-    if (THIS->kreplace->options()&KFindDialog::SelectedText) {
+    if (THIS->kreplace->options()&KFind::SelectedText) {
       THIS->kreplace->setSelection(CURRENT_VIEW->getDoc()->selStartLine(),
                                    CURRENT_VIEW->getDoc()->selStartCol(),
                                    CURRENT_VIEW->getDoc()->selEndLine(),
@@ -834,8 +834,8 @@ void SourceFileWindow::findReplace()
         THIS->kreplace->replaceCurrentLine=THIS->kreplace->selStartLine();
         replaceCurrentCol=THIS->kreplace->selStartCol();
       }
-      THIS->kreplace->setOptions(THIS->kreplace->options()&~KFindDialog::FromCursor);
-    } else if (THIS->kreplace->options()&KFindDialog::FromCursor) {
+      THIS->kreplace->setOptions(THIS->kreplace->options()&~KFind::FromCursor);
+    } else if (THIS->kreplace->options()&KFind::FromCursor) {
       if (CURRENT_VIEW->getDoc()->hasSelection()) {
         if (findBackwards) {
           THIS->kreplace->replaceCurrentLine=CURRENT_VIEW->getDoc()->selStartLine();
@@ -855,7 +855,7 @@ void SourceFileWindow::findReplace()
         if (findBackwards?(THIS->kreplace->replaceCurrentLine==(CURRENT_VIEW->getDoc()->numLines()-1)
                            && replaceCurrentCol==(CURRENT_VIEW->getDoc()->lineLength(THIS->kreplace->replaceCurrentLine)))
                          :(!THIS->kreplace->replaceCurrentLine&&!replaceCurrentCol))
-          THIS->kreplace->setOptions(THIS->kreplace->options()&~KFindDialog::FromCursor);
+          THIS->kreplace->setOptions(THIS->kreplace->options()&~KFind::FromCursor);
       }
     } else {
       THIS->kreplace->replaceCurrentLine=findBackwards?(CURRENT_VIEW->getDoc()->numLines()-1):0;
@@ -876,7 +876,7 @@ void SourceFileWindow::findReplace_next()
 
 void SourceFileWindow::findReplace_next(bool firstTime)
 {
-  bool findBackwards=!!(THIS->kreplace->options()&KFindDialog::FindBackwards);
+  bool findBackwards=!!(THIS->kreplace->options()&KFind::FindBackwards);
 
   // Reinitialize.
   if (!firstTime) {
@@ -915,8 +915,8 @@ void SourceFileWindow::findReplace_next(bool firstTime)
           :(findBackwards?!THIS->kreplace->replaceCurrentLine:(THIS->kreplace->replaceCurrentLine>=currNumLines))) {
         if (THIS->kreplace->shouldRestart()) {
           // Drop "From cursor" and "Selected text" options.
-          THIS->kreplace->setOptions(THIS->kreplace->options()&~(KFindDialog::FromCursor
-                                                                 |KFindDialog::SelectedText));
+          THIS->kreplace->setOptions(THIS->kreplace->options()&~(KFind::FromCursor
+                                                                 |KFind::SelectedText));
           THIS->kreplace->invalidateSelection();
           // Reinitialize.
           THIS->kreplace->replaceCurrentLine=findBackwards?(CURRENT_VIEW->getDoc()->numLines()-1):0;

+ 4 - 4
ktigcc/toolprops.ui.h

@@ -44,7 +44,7 @@ void ToolProperties::init()
     toolTitle->setText(tool.title);
     commandLine->setText(tool.commandLine);
     if (!tool.workingDirectory.isEmpty())
-      workingDirectory->setKURL(KURL::fromPathOrURL(tool.workingDirectory));
+      workingDirectory->setKURL(KUrl::fromPathOrUrl(tool.workingDirectory));
     runInTerminal->setChecked(tool.runInTerminal);
   }
 }
@@ -53,7 +53,7 @@ void ToolProperties::accept()
 {
   Tool tool(toolTitle->text(),commandLine->text(),
             workingDirectory->url().isEmpty()?QString():
-            KURL(workingDirectory->url()).path(),runInTerminal->isChecked());
+            KUrl(workingDirectory->url()).path(),runInTerminal->isChecked());
   if (toolIndex>=0)
     tempTools[toolIndex]=tool;
   else
@@ -66,8 +66,8 @@ void ToolProperties::validate()
   okButton->setEnabled(!toolTitle->text().isEmpty()
                        && !commandLine->text().isEmpty()
                        && (workingDirectory->url().isEmpty()
-                           || (KURL(workingDirectory->url()).isValid()
-                               && KURL(workingDirectory->url()).isLocalFile())));
+                           || (KUrl(workingDirectory->url()).isValid()
+                               && KUrl(workingDirectory->url()).isLocalFile())));
 }
 
 void ToolProperties::browseButton_clicked()

+ 3 - 3
ktigcc/toolsdlg.ui.h

@@ -30,7 +30,7 @@
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 */
 
-#include <klistview.h>
+#include <k3listview.h>
 #include "ktigcc.h"
 #include "toolprops.h"
 
@@ -41,7 +41,7 @@ void ToolsDialog::init()
   listView->setSorting(-1);
   Tools::iterator it;
   for(it=tempTools.begin(); it!=tempTools.end(); ++it)
-    new KListViewItem(listView,listView->lastItem(),(*it).title,
+    new K3ListViewItem(listView,listView->lastItem(),(*it).title,
                       (*it).commandLine,(*it).workingDirectory,
                       (*it).runInTerminal?"Yes":"No");
 }
@@ -53,7 +53,7 @@ void ToolsDialog::addButton_clicked()
   toolProperties.exec();
   if (toolProperties.result()==QDialog::Accepted) {
     Tool &newTool=tempTools.last();
-    new KListViewItem(listView,listView->lastItem(),newTool.title,
+    new K3ListViewItem(listView,listView->lastItem(),newTool.title,
                       newTool.commandLine,newTool.workingDirectory,
                       newTool.runInTerminal?"Yes":"No");
   } else listView_selectionChanged(); // set the real toolIndex again

+ 9 - 9
ktigcc/tpr.cpp

@@ -194,7 +194,7 @@ static int parse_file(FILE *f,TPRDataStruct *dest)
             { \
                 if (*p) { \
                   unsigned short *utf16=ticonv_charset_ti_to_utf16(CALC_TI89,p); \
-                  dest->var = QString::fromUcs2(utf16); \
+                  dest->var = QString::fromUtf16(utf16); \
                   g_free(utf16); \
                 } \
                 continue; \
@@ -522,7 +522,7 @@ QString loadFileText(const char *fileName)
       delete[] buffer;
       if (!utf16)
         return QString::null;
-      ret=QString::fromUcs2(utf16);
+      ret=QString::fromUtf16(utf16);
       g_free(utf16);
     } else {
       ret=buffer;
@@ -571,7 +571,7 @@ static int save_tpr(FILE *f,TPRDataStruct *dest)
     
 #define boolean_param(token,setting) if (fprintf(f,token "%d\r\n",!!dest->settings.setting)<0) return -2;
 #define tistring_vparam(token,var) { \
-        const unsigned short *utf16=dest->var.ucs2(); \
+        const unsigned short *utf16=dest->var.utf16(); \
         char *ti=utf16?ticonv_charset_utf16_to_ti(CALC_TI89,utf16):reinterpret_cast<char*>(g_malloc0(1)); \
         if (fprintf(f,token "%s\r\n",ti)<0) {g_free(ti); return -2;} \
         g_free(ti); \
@@ -769,7 +769,7 @@ void mkdir_multi(const char *fileName)
 static int writeToFile(FILE *f, const QString &text)
 {
   if (preferences.useCalcCharset) {
-    const unsigned short *utf16=text.ucs2();
+    const unsigned short *utf16=text.utf16();
     if (utf16) {
       char *s=ticonv_charset_utf16_to_ti(CALC_TI89,utf16);
       size_t l=std::strlen(s);
@@ -1038,7 +1038,7 @@ int saveFileText(const char *fileName,const QString &fileText)
                               static_cast<LineStartList *>(NULL));
 }
 
-void kurlNewFileName(KURL &dir,const QString &newFileName)
+void kurlNewFileName(KUrl &dir,const QString &newFileName)
 {
   if (newFileName[0]=='/')
     dir.setPath(newFileName);
@@ -1327,7 +1327,7 @@ QStringList process_settings(const QString &prjNameUnicode,
 
   // Convert the project name to the calculator charset.
   {
-    const unsigned short *utf16=prjNameUnicode.ucs2();
+    const unsigned short *utf16=prjNameUnicode.utf16();
     if (utf16) {
       char *ti=ticonv_charset_utf16_to_ti(CALC_TI89,utf16);
       projectName=ti; // This is a hidden strdup (see QCString::operator=).
@@ -1347,7 +1347,7 @@ QStringList process_settings(const QString &prjNameUnicode,
 
   // Convert the PPG folder name to the calculator charset.
   {
-    const unsigned short *utf16=packFolderUnicode.ucs2();
+    const unsigned short *utf16=packFolderUnicode.utf16();
     if (utf16) {
       char *ti=ticonv_charset_utf16_to_ti(CALC_TI89,utf16);
       packFolder=ti; // This is a hidden strdup (see QCString::operator=).
@@ -1357,7 +1357,7 @@ QStringList process_settings(const QString &prjNameUnicode,
 
   // Convert the PPG file name to the calculator charset.
   {
-    const unsigned short *utf16=packNameUnicode.ucs2();
+    const unsigned short *utf16=packNameUnicode.utf16();
     if (utf16) {
       char *ti=ticonv_charset_utf16_to_ti(CALC_TI89,utf16);
       packName=ti; // This is a hidden strdup (see QCString::operator=).
@@ -1368,7 +1368,7 @@ QStringList process_settings(const QString &prjNameUnicode,
   if (settings.use_data_var && !settings.data_var.isEmpty()) {
     // We can't just append this to the argument list because this needs to be
     // in the calculator charset.
-    const unsigned short *utf16=settings.data_var.ucs2();
+    const unsigned short *utf16=settings.data_var.utf16();
     if (utf16) {
       char *ti=ticonv_charset_utf16_to_ti(CALC_TI89,utf16);
       dataVarName=ti; // This is a hidden strdup (see QCString::operator=).

+ 2 - 2
ktigcc/tpr.h

@@ -23,7 +23,7 @@
 
 #pragma once
 
-class KURL;
+class KUrl;
 #include <qstring.h>
 #include <qstringlist.h>
 #include <q3cstring.h>
@@ -176,7 +176,7 @@ int saveAndSplitFileText(const char *fileName, const QString &fileText,
                          LineStartList *pLineStartList);
 int saveFileText(const char *fileName,const QString &fileText);
 
-void kurlNewFileName(KURL &dir,const QString &newFileName);
+void kurlNewFileName(KUrl &dir,const QString &newFileName);
 int checkFileName(const QString &fileName,const QStringList &fileNameList);
 
 int copyFile(const char *src, const char *dest);