Browse Source

Initialize isNew and isDirty in the ListViewFile constructor. Don't initialize them in newFile. Reset isNew in openFile.

git-svn-id: file:///var/svn/tigccpp/trunk@415 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 18 years ago
parent
commit
ac25781cfe
1 changed files with 9 additions and 6 deletions
  1. 9 6
      ktigcc/mainform.ui.h

+ 9 - 6
ktigcc/mainform.ui.h

@@ -135,7 +135,8 @@ class ListViewFolder : public QListViewItem {
 class ListViewFile : public QListViewItem {
   public:
   ListViewFile(QListView *parent) : QListViewItem(parent),
-                                    cursorLine(1), cursorCol(0)
+                                    cursorLine(1), cursorCol(0),
+                                    isNew(TRUE), isDirty(FALSE)
   {
     setPixmap(0,QPixmap::fromMimeSource("filex.png"));    
     setDragEnabled(TRUE);
@@ -143,7 +144,8 @@ class ListViewFile : public QListViewItem {
     setRenameEnabled(0,TRUE);
   }
   ListViewFile(QListViewItem *parent) : QListViewItem(parent),
-                                        cursorLine(1), cursorCol(0)
+                                        cursorLine(1), cursorCol(0),
+                                        isNew(TRUE), isDirty(FALSE)
   {
     setPixmap(0,QPixmap::fromMimeSource("filex.png"));
     setDragEnabled(TRUE);
@@ -151,7 +153,8 @@ class ListViewFile : public QListViewItem {
     setRenameEnabled(0,TRUE);
   }
   ListViewFile(QListView *parent, QListViewItem *after)
-          : QListViewItem(parent, after), cursorLine(1), cursorCol(0)
+          : QListViewItem(parent, after), cursorLine(1), cursorCol(0),
+            isNew(TRUE), isDirty(FALSE)
   {
     setPixmap(0,QPixmap::fromMimeSource("filex.png"));
     setDropEnabled(TRUE);
@@ -159,7 +162,8 @@ class ListViewFile : public QListViewItem {
     setRenameEnabled(0,TRUE);
   }
   ListViewFile(QListViewItem *parent, QListViewItem *after)
-          : QListViewItem(parent, after), cursorLine(1), cursorCol(0)
+          : QListViewItem(parent, after), cursorLine(1), cursorCol(0),
+            isNew(TRUE), isDirty(FALSE)
   {
     setPixmap(0,QPixmap::fromMimeSource("filex.png"));
     setDragEnabled(TRUE);
@@ -634,6 +638,7 @@ QListViewItem * MainForm::openFile(QListViewItem * category, QListViewItem * par
     item=next;
   ListViewFile *newFile=item?new ListViewFile(parent,item)
                         :new ListViewFile(parent);
+  newFile->isNew=FALSE;
   newFile->setText(0,fileCaption);
   newFile->setPixmap(0,QPixmap::fromMimeSource(
     category==cFilesListItem||category==qllFilesListItem?"filec.png":
@@ -1264,8 +1269,6 @@ void MainForm::newFile( QListViewItem *parent, QString text, const char *iconNam
                         :new ListViewFile(parent);
   
   newFile->fileName=tmp;
-  newFile->isNew=TRUE;
-  newFile->isDirty=FALSE;
   
   newFile->setText(0,caption);
   newFile->setPixmap(0,QPixmap::fromMimeSource(iconName));