-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 198 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 862 |
2 files changed, 538 insertions, 522 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 3250a66..f31956c 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -1,170 +1,172 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfm.h | 2 | advancedfm.h |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #ifndef ADVANCEDFM_H | 12 | #ifndef ADVANCEDFM_H |
13 | #define ADVANCEDFM_H | 13 | #define ADVANCEDFM_H |
14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties | 14 | #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties |
15 | #define QT_QWS_OPIE | 15 | #define QT_QWS_OPIE |
16 | 16 | ||
17 | //#include <opie/otabwidget.h> | 17 | //#include <opie/otabwidget.h> |
18 | #include <opie/oprocess.h> | ||
18 | #include <qpe/ir.h> | 19 | #include <qpe/ir.h> |
19 | 20 | ||
20 | #include <qvariant.h> | 21 | #include <qvariant.h> |
21 | #include <qdialog.h> | 22 | #include <qdialog.h> |
22 | #include <qmainwindow.h> | 23 | #include <qmainwindow.h> |
23 | #include <qstringlist.h> | 24 | #include <qstringlist.h> |
24 | #include <qdir.h> | 25 | #include <qdir.h> |
25 | #include <qstring.h> | 26 | #include <qstring.h> |
26 | #include <qpoint.h> | 27 | #include <qpoint.h> |
27 | #include <qtimer.h> | 28 | #include <qtimer.h> |
28 | 29 | ||
29 | class OTabWidget; | 30 | class OTabWidget; |
30 | class QVBoxLayout; | 31 | class QVBoxLayout; |
31 | class QHBoxLayout; | 32 | class QHBoxLayout; |
32 | class QGridLayout; | 33 | class QGridLayout; |
33 | class QComboBox; | 34 | class QComboBox; |
34 | class QListView; | 35 | class QListView; |
35 | class QListviewItem; | 36 | class QListviewItem; |
36 | class QLabel; | 37 | class QLabel; |
37 | class QProgressBar; | 38 | class QProgressBar; |
38 | class QSpinBox; | 39 | class QSpinBox; |
39 | class QTabWidget; | 40 | class QTabWidget; |
40 | class QWidget; | 41 | class QWidget; |
41 | class QPEToolBar; | 42 | class QPEToolBar; |
42 | class QPEMenuBar; | 43 | class QPEMenuBar; |
43 | class QPopupMenu; | 44 | class QPopupMenu; |
44 | class QFile; | 45 | class QFile; |
45 | class QListViewItem; | 46 | class QListViewItem; |
46 | class QLineEdit; | 47 | class QLineEdit; |
47 | class MenuButton; | 48 | class MenuButton; |
48 | 49 | ||
49 | //class QPushButton; | 50 | //class QPushButton; |
50 | class QToolButton; | 51 | class QToolButton; |
51 | class Ir; | 52 | class Ir; |
52 | 53 | ||
53 | class AdvancedFm : public QMainWindow | 54 | class AdvancedFm : public QMainWindow |
54 | { | 55 | { |
55 | Q_OBJECT | 56 | Q_OBJECT |
56 | public: | 57 | public: |
57 | AdvancedFm(); | 58 | AdvancedFm(); |
58 | ~AdvancedFm(); | 59 | ~AdvancedFm(); |
59 | protected slots: | 60 | protected slots: |
60 | void selectAll(); | 61 | void selectAll(); |
61 | void addToDocs(); | 62 | void addToDocs(); |
62 | void doDirChange(); | 63 | void doDirChange(); |
63 | void mkDir(); | 64 | void mkDir(); |
64 | void del(); | 65 | void del(); |
65 | void rn(); | 66 | void rn(); |
66 | void populateView(); | 67 | void populateView(); |
67 | void rePopulate(); | 68 | void rePopulate(); |
68 | void showHidden(); | 69 | void showHidden(); |
69 | void showMenuHidden(); | 70 | void showMenuHidden(); |
70 | void writeConfig(); | 71 | void writeConfig(); |
71 | void readConfig(); | 72 | void readConfig(); |
72 | void ListClicked(QListViewItem *); | 73 | void ListClicked(QListViewItem *); |
73 | void ListPressed( int, QListViewItem *, const QPoint&, int); | 74 | void ListPressed( int, QListViewItem *, const QPoint&, int); |
74 | void makeDir(); | 75 | void makeDir(); |
75 | void doDelete(); | 76 | void doDelete(); |
76 | void tabChanged(QWidget*); | 77 | void tabChanged(QWidget*); |
77 | void cleanUp(); | 78 | void cleanUp(); |
78 | void renameIt(); | 79 | void renameIt(); |
79 | void runThis(); | 80 | void runThis(); |
80 | void runText(); | 81 | void runText(); |
81 | void filePerms(); | 82 | void filePerms(); |
82 | void doProperties(); | 83 | void doProperties(); |
83 | void runCommand(); | 84 | void runCommand(); |
84 | void runCommandStd(); | 85 | void runCommandStd(); |
85 | QStringList getPath(); | 86 | QStringList getPath(); |
86 | void mkSym(); | 87 | void mkSym(); |
87 | void switchToLocalTab(); | 88 | void switchToLocalTab(); |
88 | void switchToRemoteTab(); | 89 | void switchToRemoteTab(); |
89 | 90 | ||
90 | protected: | 91 | protected: |
91 | 92 | ||
92 | OTabWidget *TabWidget; | 93 | OTabWidget *TabWidget; |
93 | int whichTab; | 94 | int whichTab; |
94 | // QTabWidget *TabWidget; | 95 | // QTabWidget *TabWidget; |
95 | QWidget *tab, *tab_2, *tab_3; | 96 | QWidget *tab, *tab_2, *tab_3; |
96 | QListView *Local_View, *Remote_View; | 97 | QListView *Local_View, *Remote_View; |
97 | 98 | ||
98 | QLineEdit *currentPathEdit; | 99 | QLineEdit *currentPathEdit; |
99 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; | 100 | QPopupMenu *fileMenu, *localMenu, *remoteMenu, *viewMenu /*, *customDirMenu*/; |
100 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 101 | QToolButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
101 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; | 102 | // QPushButton *homeButton, *docButton, *cdUpButton, *sdButton, *cfButton, *qpeDirButton; |
102 | QDir currentDir, currentRemoteDir; | 103 | QDir currentDir, currentRemoteDir; |
103 | QComboBox *currentPathCombo; | 104 | QComboBox *currentPathCombo; |
104 | QString filterStr, s_addBookmark, s_removeBookmark; | 105 | QString filterStr, s_addBookmark, s_removeBookmark; |
105 | QListViewItem * item; | 106 | QListViewItem * item; |
106 | bool b; | 107 | bool b; |
107 | QStringList fileSystemTypeList, fsList; | 108 | QStringList fileSystemTypeList, fsList; |
108 | int currentServerConfig; | 109 | int currentServerConfig; |
109 | bool zaurusDevice; | 110 | bool zaurusDevice; |
110 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; | 111 | QGridLayout *tabLayout, *tabLayout_2, *tabLayout_3; |
111 | QStringList remoteDirPathStringList, localDirPathStringList; | 112 | QStringList remoteDirPathStringList, localDirPathStringList; |
112 | QLineEdit *renameBox; | 113 | QLineEdit *renameBox; |
113 | 114 | ||
114 | void init(); | 115 | void init(); |
115 | void initConnections(); | 116 | void initConnections(); |
116 | void keyReleaseEvent( QKeyEvent *); | 117 | void keyReleaseEvent( QKeyEvent *); |
117 | void keyPressEvent( QKeyEvent *); | 118 | void keyPressEvent( QKeyEvent *); |
118 | QString getFileSystemType(const QString &); | 119 | QString getFileSystemType(const QString &); |
119 | QString getDiskSpace(const QString &); | 120 | QString getDiskSpace(const QString &); |
120 | void parsetab(const QString &fileName); | 121 | void parsetab(const QString &fileName); |
121 | QString checkDiskSpace(const QString &); | 122 | QString checkDiskSpace(const QString &); |
122 | QString dealWithSymName(const QString &); | 123 | QString dealWithSymName(const QString &); |
123 | QDir *CurrentDir(); | 124 | QDir *CurrentDir(); |
124 | QDir *OtherDir(); | 125 | QDir *OtherDir(); |
125 | QListView *CurrentView(); | 126 | QListView *CurrentView(); |
126 | QListView *OtherView(); | 127 | QListView *OtherView(); |
127 | void setOtherTabCurrent(); | 128 | void setOtherTabCurrent(); |
128 | 129 | ||
129 | protected slots: | 130 | protected slots: |
130 | void dirMenuSelected(int); | 131 | void dirMenuSelected(int); |
131 | void showFileMenu(); | 132 | void showFileMenu(); |
132 | void cancelMenuTimer(); | 133 | void cancelMenuTimer(); |
133 | void homeButtonPushed(); | 134 | void homeButtonPushed(); |
134 | void docButtonPushed(); | 135 | void docButtonPushed(); |
135 | void SDButtonPushed(); | 136 | void SDButtonPushed(); |
136 | void CFButtonPushed(); | 137 | void CFButtonPushed(); |
137 | void QPEButtonPushed(); | 138 | void QPEButtonPushed(); |
138 | void upDir(); | 139 | void upDir(); |
139 | void currentPathComboChanged(); | 140 | void currentPathComboChanged(); |
140 | void copy(); | 141 | void copy(); |
141 | void copyAs(); | 142 | void copyAs(); |
142 | void copySameDir(); | 143 | void copySameDir(); |
143 | void currentPathComboActivated(const QString &); | 144 | void currentPathComboActivated(const QString &); |
144 | void fillCombo(const QString &); | 145 | void fillCombo(const QString &); |
145 | bool copyFile( const QString & , const QString & ); | 146 | bool copyFile( const QString & , const QString & ); |
146 | void move(); | 147 | void move(); |
147 | void fileStatus(); | 148 | void fileStatus(); |
148 | void doAbout(); | 149 | void doAbout(); |
149 | void doBeam(); | 150 | void doBeam(); |
150 | void fileBeamFinished( Ir *); | 151 | void fileBeamFinished( Ir *); |
151 | 152 | ||
152 | private: | 153 | private: |
153 | MenuButton *menuButton; | 154 | MenuButton *menuButton; |
154 | QString oldName; | 155 | QString oldName; |
155 | QTimer menuTimer; | 156 | QTimer menuTimer; |
156 | void startProcess(const QString &); | 157 | void startProcess(const QString &); |
157 | bool eventFilter( QObject * , QEvent * ); | 158 | bool eventFilter( QObject * , QEvent * ); |
158 | void cancelRename(); | 159 | void cancelRename(); |
159 | void doRename(QListView *); | 160 | void doRename(QListView *); |
160 | void okRename(); | 161 | void okRename(); |
161 | void customDirsToMenu(); | 162 | void customDirsToMenu(); |
162 | void addCustomDir(); | 163 | void addCustomDir(); |
163 | void removeCustomDir(); | 164 | void removeCustomDir(); |
164 | 165 | ||
165 | private slots: | 166 | private slots: |
166 | void processEnded(); | 167 | void processEnded(OProcess *); |
167 | void gotoCustomDir(const QString &); | 168 | void oprocessStderr(OProcess *, char *, int); |
169 | void gotoCustomDir(const QString &); | ||
168 | }; | 170 | }; |
169 | 171 | ||
170 | #endif // ADVANCEDFM_H | 172 | #endif // ADVANCEDFM_H |
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index a82d69a..eac13f6 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -1,850 +1,864 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | AdvancedFm.cpp | 2 | AdvancedFm.cpp |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | #include "output.h" | 13 | #include "output.h" |
14 | #include "filePermissions.h" | 14 | #include "filePermissions.h" |
15 | 15 | ||
16 | #include <opie/otabwidget.h> | 16 | #include <opie/otabwidget.h> |
17 | #include <opie/oprocess.h> | 17 | #include <opie/oprocess.h> |
18 | 18 | ||
19 | #include <qpe/lnkproperties.h> | 19 | #include <qpe/lnkproperties.h> |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qpe/qpemenubar.h> | 21 | #include <qpe/qpemenubar.h> |
22 | #include <qpe/qpetoolbar.h> | 22 | #include <qpe/qpetoolbar.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/applnk.h> | 25 | #include <qpe/applnk.h> |
26 | #include <qpe/ir.h> | 26 | #include <qpe/ir.h> |
27 | 27 | ||
28 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
29 | #include <qmultilineedit.h> | 29 | #include <qmultilineedit.h> |
30 | 30 | ||
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | 32 | ||
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | #include <qcombobox.h> | 35 | #include <qcombobox.h> |
36 | #include <qpopupmenu.h> | 36 | #include <qpopupmenu.h> |
37 | #include <qtabwidget.h> | 37 | #include <qtabwidget.h> |
38 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
39 | #include <qtabwidget.h> | 39 | #include <qtabwidget.h> |
40 | #include <qlineedit.h> | 40 | #include <qlineedit.h> |
41 | #include <qlistview.h> | 41 | #include <qlistview.h> |
42 | 42 | ||
43 | #include <stdlib.h> | 43 | #include <stdlib.h> |
44 | #include <unistd.h> | 44 | #include <unistd.h> |
45 | #include <sys/stat.h> | 45 | #include <sys/stat.h> |
46 | #include <dirent.h> | 46 | #include <dirent.h> |
47 | 47 | ||
48 | 48 | ||
49 | void AdvancedFm::doDirChange() | 49 | void AdvancedFm::doDirChange() |
50 | { | 50 | { |
51 | ListClicked( CurrentView()->currentItem()); | 51 | ListClicked( CurrentView()->currentItem()); |
52 | } | 52 | } |
53 | 53 | ||
54 | void AdvancedFm::showMenuHidden() | 54 | void AdvancedFm::showMenuHidden() |
55 | { | 55 | { |
56 | if (b) | 56 | if (b) |
57 | { | 57 | { |
58 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 58 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
59 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 59 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
60 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 60 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
61 | // b=FALSE; | 61 | // b=FALSE; |
62 | 62 | ||
63 | } | 63 | } |
64 | else | 64 | else |
65 | { | 65 | { |
66 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 66 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
67 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 67 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
69 | // b=TRUE; | 69 | // b=TRUE; |
70 | } | 70 | } |
71 | rePopulate(); | 71 | rePopulate(); |
72 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); | 72 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); |
73 | if(b) b = false; else b = true; | 73 | if(b) b = false; else b = true; |
74 | } | 74 | } |
75 | 75 | ||
76 | void AdvancedFm::showHidden() | 76 | void AdvancedFm::showHidden() |
77 | { | 77 | { |
78 | if (b) | 78 | if (b) |
79 | { | 79 | { |
80 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 80 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
81 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 81 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
82 | // fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 82 | // fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
83 | // b=FALSE; | 83 | // b=FALSE; |
84 | 84 | ||
85 | } | 85 | } |
86 | else | 86 | else |
87 | { | 87 | { |
88 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 88 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
89 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 89 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
90 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 90 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
91 | // b=TRUE; | 91 | // b=TRUE; |
92 | } | 92 | } |
93 | rePopulate(); | 93 | rePopulate(); |
94 | } | 94 | } |
95 | 95 | ||
96 | QString AdvancedFm::dealWithSymName(const QString &fileName) | 96 | QString AdvancedFm::dealWithSymName(const QString &fileName) |
97 | { | 97 | { |
98 | QString strItem = fileName; | 98 | QString strItem = fileName; |
99 | return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 99 | return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
100 | } | 100 | } |
101 | 101 | ||
102 | void AdvancedFm::runThis() | 102 | void AdvancedFm::runThis() |
103 | { | 103 | { |
104 | QString fs; | 104 | QString fs; |
105 | QDir *thisDir = CurrentDir(); | 105 | QDir *thisDir = CurrentDir(); |
106 | 106 | ||
107 | QString curFile = CurrentView()->currentItem()->text(0); | 107 | QString curFile = CurrentView()->currentItem()->text(0); |
108 | QString path = thisDir->canonicalPath(); | 108 | QString path = thisDir->canonicalPath(); |
109 | 109 | ||
110 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 110 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
111 | 111 | ||
112 | curFile = dealWithSymName((const QString&)curFile); | 112 | curFile = dealWithSymName((const QString&)curFile); |
113 | 113 | ||
114 | if(curFile != "../") | 114 | if(curFile != "../") |
115 | { | 115 | { |
116 | 116 | ||
117 | fs = getFileSystemType((const QString &) path); | 117 | fs = getFileSystemType((const QString &) path); |
118 | QFileInfo fileInfo( path + "/" + curFile); | 118 | QFileInfo fileInfo( path + "/" + curFile); |
119 | qDebug( fileInfo.owner()); | 119 | qDebug( fileInfo.owner()); |
120 | 120 | ||
121 | if( (fileInfo.permission( QFileInfo::ExeUser) | 121 | if( (fileInfo.permission( QFileInfo::ExeUser) |
122 | | fileInfo.permission( QFileInfo::ExeGroup) | 122 | | fileInfo.permission( QFileInfo::ExeGroup) |
123 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { | 123 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { |
124 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { | 124 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { |
125 | QCopEnvelope e("QPE/System", "execute(QString)" ); | 125 | QCopEnvelope e("QPE/System", "execute(QString)" ); |
126 | e << curFile; | 126 | e << curFile; |
127 | } | 127 | } |
128 | else | 128 | else |
129 | { | 129 | { |
130 | curFile = path + "/" + curFile; | 130 | curFile = path + "/" + curFile; |
131 | DocLnk nf(curFile); | 131 | DocLnk nf(curFile); |
132 | QString execStr = nf.exec(); | 132 | QString execStr = nf.exec(); |
133 | qDebug( execStr); | 133 | qDebug( execStr); |
134 | if( execStr.isEmpty() ) | 134 | if( execStr.isEmpty() ) |
135 | { | 135 | { |
136 | } | 136 | } |
137 | else | 137 | else |
138 | { | 138 | { |
139 | nf.execute(); | 139 | nf.execute(); |
140 | } | 140 | } |
141 | } | 141 | } |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | void AdvancedFm::runText() | 145 | void AdvancedFm::runText() |
146 | { | 146 | { |
147 | QString curFile = CurrentView()->currentItem()->text(0); | 147 | QString curFile = CurrentView()->currentItem()->text(0); |
148 | if(curFile != "../") | 148 | if(curFile != "../") |
149 | { | 149 | { |
150 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 150 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
151 | curFile = dealWithSymName((const QString&)curFile); | 151 | curFile = dealWithSymName((const QString&)curFile); |
152 | curFile = CurrentDir()->canonicalPath()+"/"+curFile; | 152 | curFile = CurrentDir()->canonicalPath()+"/"+curFile; |
153 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); | 153 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); |
154 | e << curFile; | 154 | e << curFile; |
155 | } | 155 | } |
156 | } | 156 | } |
157 | 157 | ||
158 | void AdvancedFm::makeDir() | 158 | void AdvancedFm::makeDir() |
159 | { | 159 | { |
160 | InputDialog *fileDlg; | 160 | InputDialog *fileDlg; |
161 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 161 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
162 | fileDlg->exec(); | 162 | fileDlg->exec(); |
163 | if( fileDlg->result() == 1 ) | 163 | if( fileDlg->result() == 1 ) |
164 | { | 164 | { |
165 | QDir *thisDir = CurrentDir(); | 165 | QDir *thisDir = CurrentDir(); |
166 | QString filename = fileDlg->LineEdit1->text(); | 166 | QString filename = fileDlg->LineEdit1->text(); |
167 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); | 167 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); |
168 | } | 168 | } |
169 | populateView(); | 169 | populateView(); |
170 | } | 170 | } |
171 | 171 | ||
172 | void AdvancedFm::doDelete() | 172 | void AdvancedFm::doDelete() |
173 | { | 173 | { |
174 | 174 | ||
175 | QStringList curFileList = getPath(); | 175 | QStringList curFileList = getPath(); |
176 | bool doMsg=true; | 176 | bool doMsg=true; |
177 | int count = curFileList.count(); | 177 | int count = curFileList.count(); |
178 | if( count > 0) | 178 | if( count > 0) |
179 | { | 179 | { |
180 | if(count > 1 ) | 180 | if(count > 1 ) |
181 | { | 181 | { |
182 | QString msg; | 182 | QString msg; |
183 | msg=tr("Really delete\n%1 files?").arg(count); | 183 | msg=tr("Really delete\n%1 files?").arg(count); |
184 | switch ( QMessageBox::warning(this,tr("Delete"),msg | 184 | switch ( QMessageBox::warning(this,tr("Delete"),msg |
185 | ,tr("Yes"),tr("No"),0,0,1) ) | 185 | ,tr("Yes"),tr("No"),0,0,1) ) |
186 | { | 186 | { |
187 | case 0: | 187 | case 0: |
188 | doMsg=false; | 188 | doMsg=false; |
189 | break; | 189 | break; |
190 | case 1: | 190 | case 1: |
191 | return; | 191 | return; |
192 | break; | 192 | break; |
193 | }; | 193 | }; |
194 | } | 194 | } |
195 | 195 | ||
196 | QString myFile; | 196 | QString myFile; |
197 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 197 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
198 | { | 198 | { |
199 | myFile = (*it); | 199 | myFile = (*it); |
200 | if( myFile.find(" -> ",0,TRUE) != -1) | 200 | if( myFile.find(" -> ",0,TRUE) != -1) |
201 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); | 201 | myFile = myFile.left( myFile.find(" -> ",0,TRUE)); |
202 | 202 | ||
203 | QString f = CurrentDir()->canonicalPath(); | 203 | QString f = CurrentDir()->canonicalPath(); |
204 | if(f.right(1).find("/",0,TRUE) == -1) | 204 | if(f.right(1).find("/",0,TRUE) == -1) |
205 | f += "/"; | 205 | f += "/"; |
206 | f += myFile; | 206 | f += myFile; |
207 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) | 207 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) |
208 | { | 208 | { |
209 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("Really delete\n") + f + | 209 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("Really delete\n") + f + |
210 | "\nand all it's contents ?" | 210 | "\nand all it's contents ?" |
211 | ,tr("Yes"),tr("No"),0,0,1) ) | 211 | ,tr("Yes"),tr("No"),0,0,1) ) |
212 | { | 212 | { |
213 | case 0: | 213 | case 0: |
214 | { | 214 | { |
215 | f=f.left(f.length()-1); | 215 | f=f.left(f.length()-1); |
216 | QString cmd="rm -rf "+f; | 216 | QString cmd="rm -rf "+f; |
217 | startProcess( (const QString)cmd.latin1() ); | 217 | startProcess( (const QString)cmd.latin1() ); |
218 | populateView(); | 218 | populateView(); |
219 | } | 219 | } |
220 | break; | 220 | break; |
221 | case 1: | 221 | case 1: |
222 | // exit | 222 | // exit |
223 | break; | 223 | break; |
224 | }; | 224 | }; |
225 | 225 | ||
226 | } else { | 226 | } else { |
227 | if(doMsg) { | 227 | if(doMsg) { |
228 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f | 228 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Really delete\n")+f |
229 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { | 229 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { |
230 | case 1: | 230 | case 1: |
231 | return; | 231 | return; |
232 | break; | 232 | break; |
233 | }; | 233 | }; |
234 | } | 234 | } |
235 | QString cmd="rm "+f; | 235 | QString cmd="rm "+f; |
236 | QFile file(f); | 236 | QFile file(f); |
237 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) | 237 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) |
238 | file.remove(); | 238 | file.remove(); |
239 | } | 239 | } |
240 | } | 240 | } |
241 | } | 241 | } |
242 | populateView(); | 242 | populateView(); |
243 | } | 243 | } |
244 | 244 | ||
245 | void AdvancedFm::filePerms() | 245 | void AdvancedFm::filePerms() |
246 | { | 246 | { |
247 | QStringList curFileList = getPath(); | 247 | QStringList curFileList = getPath(); |
248 | QString filePath; | 248 | QString filePath; |
249 | 249 | ||
250 | filePath = CurrentDir()->canonicalPath()+"/"; | 250 | filePath = CurrentDir()->canonicalPath()+"/"; |
251 | 251 | ||
252 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 252 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
253 | { | 253 | { |
254 | filePermissions *filePerm; | 254 | filePermissions *filePerm; |
255 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); | 255 | filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); |
256 | filePerm->showMaximized(); | 256 | filePerm->showMaximized(); |
257 | filePerm->exec(); | 257 | filePerm->exec(); |
258 | if( filePerm) | 258 | if( filePerm) |
259 | delete filePerm; | 259 | delete filePerm; |
260 | } | 260 | } |
261 | populateView(); | 261 | populateView(); |
262 | } | 262 | } |
263 | 263 | ||
264 | void AdvancedFm::doProperties() | 264 | void AdvancedFm::doProperties() |
265 | { | 265 | { |
266 | #if defined(QT_QWS_OPIE) | 266 | #if defined(QT_QWS_OPIE) |
267 | 267 | ||
268 | QStringList curFileList = getPath(); | 268 | QStringList curFileList = getPath(); |
269 | 269 | ||
270 | QString filePath; | 270 | QString filePath; |
271 | filePath = CurrentDir()->canonicalPath()+"/"; | 271 | filePath = CurrentDir()->canonicalPath()+"/"; |
272 | 272 | ||
273 | qDebug("%d",curFileList.count()); | 273 | qDebug("%d",curFileList.count()); |
274 | 274 | ||
275 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 275 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
276 | { | 276 | { |
277 | qDebug((filePath+*it)); | 277 | qDebug((filePath+*it)); |
278 | DocLnk lnk( (filePath+*it)); | 278 | DocLnk lnk( (filePath+*it)); |
279 | LnkProperties prop( &lnk ); | 279 | LnkProperties prop( &lnk ); |
280 | prop.showMaximized(); | 280 | prop.showMaximized(); |
281 | prop.exec(); | 281 | prop.exec(); |
282 | } | 282 | } |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | } | 285 | } |
286 | 286 | ||
287 | void AdvancedFm::upDir() | 287 | void AdvancedFm::upDir() |
288 | { | 288 | { |
289 | QDir *thisDir = CurrentDir(); | 289 | QDir *thisDir = CurrentDir(); |
290 | QString current = thisDir->canonicalPath(); | 290 | QString current = thisDir->canonicalPath(); |
291 | QDir dir(current); | 291 | QDir dir(current); |
292 | dir.cdUp(); | 292 | dir.cdUp(); |
293 | current = dir.canonicalPath(); | 293 | current = dir.canonicalPath(); |
294 | chdir( current.latin1() ); | 294 | chdir( current.latin1() ); |
295 | thisDir->cd( current, TRUE); | 295 | thisDir->cd( current, TRUE); |
296 | 296 | ||
297 | populateView(); | 297 | populateView(); |
298 | update(); | 298 | update(); |
299 | } | 299 | } |
300 | 300 | ||
301 | void AdvancedFm::copy() | 301 | void AdvancedFm::copy() |
302 | { | 302 | { |
303 | qApp->processEvents(); | 303 | qApp->processEvents(); |
304 | QStringList curFileList = getPath(); | 304 | QStringList curFileList = getPath(); |
305 | 305 | ||
306 | QDir *thisDir = CurrentDir(); | 306 | QDir *thisDir = CurrentDir(); |
307 | QDir *thatDir = OtherDir(); | 307 | QDir *thatDir = OtherDir(); |
308 | 308 | ||
309 | bool doMsg=true; | 309 | bool doMsg=true; |
310 | int count=curFileList.count(); | 310 | int count=curFileList.count(); |
311 | if( count > 0) { | 311 | if( count > 0) { |
312 | if(count > 1 ){ | 312 | if(count > 1 ){ |
313 | QString msg; | 313 | QString msg; |
314 | msg=tr("Really copy\n%1 files?").arg(count); | 314 | msg=tr("Really copy\n%1 files?").arg(count); |
315 | switch ( QMessageBox::warning(this,tr("Delete"),msg | 315 | switch ( QMessageBox::warning(this,tr("Delete"),msg |
316 | ,tr("Yes"),tr("No"),0,0,1) ) | 316 | ,tr("Yes"),tr("No"),0,0,1) ) |
317 | { | 317 | { |
318 | case 0: | 318 | case 0: |
319 | doMsg=false; | 319 | doMsg=false; |
320 | break; | 320 | break; |
321 | case 1: | 321 | case 1: |
322 | return; | 322 | return; |
323 | break; | 323 | break; |
324 | }; | 324 | }; |
325 | } | 325 | } |
326 | 326 | ||
327 | QString curFile, item, destFile; | 327 | QString curFile, item, destFile; |
328 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 328 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
329 | { | 329 | { |
330 | item=(*it); | 330 | item=(*it); |
331 | if(item.find("->",0,TRUE)) //symlink | 331 | if(item.find("->",0,TRUE)) //symlink |
332 | item = item.left(item.find("->",0,TRUE)); | 332 | item = item.left(item.find("->",0,TRUE)); |
333 | 333 | ||
334 | curFile = thisDir->canonicalPath()+"/"+ item; | 334 | curFile = thisDir->canonicalPath()+"/"+ item; |
335 | destFile = thatDir->canonicalPath()+"/"+ item; | 335 | destFile = thatDir->canonicalPath()+"/"+ item; |
336 | 336 | ||
337 | qDebug("Destination file is "+destFile); | 337 | qDebug("Destination file is "+destFile); |
338 | qDebug("CurrentFile file is " + curFile); | 338 | qDebug("CurrentFile file is " + curFile); |
339 | 339 | ||
340 | QFile f(destFile); | 340 | QFile f(destFile); |
341 | if( f.exists()) | 341 | if( f.exists()) |
342 | { | 342 | { |
343 | if(doMsg) | 343 | if(doMsg) |
344 | { | 344 | { |
345 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 345 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
346 | tr("%1 exists. Ok to overwrite?").arg( item ), | 346 | tr("%1 exists. Ok to overwrite?").arg( item ), |
347 | tr("Yes"),tr("No"),0,0,1) ) | 347 | tr("Yes"),tr("No"),0,0,1) ) |
348 | { | 348 | { |
349 | case 1: | 349 | case 1: |
350 | return; | 350 | return; |
351 | break; | 351 | break; |
352 | }; | 352 | }; |
353 | } | 353 | } |
354 | f.remove(); | 354 | f.remove(); |
355 | } | 355 | } |
356 | 356 | ||
357 | if( !copyFile( curFile, destFile) ) | 357 | if( !copyFile( curFile, destFile) ) |
358 | { | 358 | { |
359 | QMessageBox::message("AdvancedFm", | 359 | QMessageBox::message("AdvancedFm", |
360 | tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); | 360 | tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); |
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | } | 363 | } |
364 | setOtherTabCurrent(); | 364 | setOtherTabCurrent(); |
365 | populateView(); | 365 | populateView(); |
366 | } | 366 | } |
367 | } | 367 | } |
368 | 368 | ||
369 | void AdvancedFm::copyAs() | 369 | void AdvancedFm::copyAs() |
370 | { | 370 | { |
371 | qApp->processEvents(); | 371 | qApp->processEvents(); |
372 | 372 | ||
373 | QStringList curFileList = getPath(); | 373 | QStringList curFileList = getPath(); |
374 | QString curFile, item; | 374 | QString curFile, item; |
375 | InputDialog *fileDlg; | 375 | InputDialog *fileDlg; |
376 | 376 | ||
377 | QDir *thisDir = CurrentDir(); | 377 | QDir *thisDir = CurrentDir(); |
378 | QDir *thatDir = OtherDir(); | 378 | QDir *thatDir = OtherDir(); |
379 | 379 | ||
380 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 380 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
381 | { | 381 | { |
382 | QString destFile; | 382 | QString destFile; |
383 | item=(*it); | 383 | item=(*it); |
384 | curFile = thisDir->canonicalPath()+"/"+(*it); | 384 | curFile = thisDir->canonicalPath()+"/"+(*it); |
385 | fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0); | 385 | fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0); |
386 | 386 | ||
387 | fileDlg->setInputText((const QString &) destFile ); | 387 | fileDlg->setInputText((const QString &) destFile ); |
388 | fileDlg->exec(); | 388 | fileDlg->exec(); |
389 | 389 | ||
390 | if( fileDlg->result() == 1 ) | 390 | if( fileDlg->result() == 1 ) |
391 | { | 391 | { |
392 | QString filename = fileDlg->LineEdit1->text(); | 392 | QString filename = fileDlg->LineEdit1->text(); |
393 | destFile = thatDir->canonicalPath()+"/"+filename; | 393 | destFile = thatDir->canonicalPath()+"/"+filename; |
394 | 394 | ||
395 | QFile f( destFile); | 395 | QFile f( destFile); |
396 | if( f.exists()) | 396 | if( f.exists()) |
397 | { | 397 | { |
398 | switch (QMessageBox::warning(this,tr("File Exists!"), | 398 | switch (QMessageBox::warning(this,tr("File Exists!"), |
399 | item+tr("\nexists. Ok to overwrite?"), | 399 | item+tr("\nexists. Ok to overwrite?"), |
400 | tr("Yes"),tr("No"),0,0,1) ) | 400 | tr("Yes"),tr("No"),0,0,1) ) |
401 | { | 401 | { |
402 | case 0: | 402 | case 0: |
403 | f.remove(); | 403 | f.remove(); |
404 | break; | 404 | break; |
405 | case 1: | 405 | case 1: |
406 | return; | 406 | return; |
407 | break; | 407 | break; |
408 | }; | 408 | }; |
409 | } | 409 | } |
410 | if( !copyFile( curFile, destFile) ) | 410 | if( !copyFile( curFile, destFile) ) |
411 | { | 411 | { |
412 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 412 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
413 | +curFile +tr("to\n")+destFile); | 413 | +curFile +tr("to\n")+destFile); |
414 | return; | 414 | return; |
415 | } | 415 | } |
416 | } | 416 | } |
417 | delete fileDlg; | 417 | delete fileDlg; |
418 | 418 | ||
419 | } | 419 | } |
420 | setOtherTabCurrent(); | 420 | setOtherTabCurrent(); |
421 | populateView(); | 421 | populateView(); |
422 | } | 422 | } |
423 | 423 | ||
424 | void AdvancedFm::copySameDir() | 424 | void AdvancedFm::copySameDir() |
425 | { | 425 | { |
426 | qApp->processEvents(); | 426 | qApp->processEvents(); |
427 | QStringList curFileList = getPath(); | 427 | QStringList curFileList = getPath(); |
428 | QString curFile, item, destFile; | 428 | QString curFile, item, destFile; |
429 | InputDialog *fileDlg; | 429 | InputDialog *fileDlg; |
430 | 430 | ||
431 | QDir *thisDir = CurrentDir(); | 431 | QDir *thisDir = CurrentDir(); |
432 | 432 | ||
433 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 433 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
434 | { | 434 | { |
435 | item=(*it); | 435 | item=(*it); |
436 | curFile = thisDir->canonicalPath()+"/"+ item; | 436 | curFile = thisDir->canonicalPath()+"/"+ item; |
437 | 437 | ||
438 | fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); | 438 | fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); |
439 | fileDlg->setInputText((const QString &) destFile ); | 439 | fileDlg->setInputText((const QString &) destFile ); |
440 | fileDlg->exec(); | 440 | fileDlg->exec(); |
441 | 441 | ||
442 | if( fileDlg->result() == 1 ) | 442 | if( fileDlg->result() == 1 ) |
443 | { | 443 | { |
444 | 444 | ||
445 | QString filename = fileDlg->LineEdit1->text(); | 445 | QString filename = fileDlg->LineEdit1->text(); |
446 | destFile = thisDir->canonicalPath()+"/"+filename; | 446 | destFile = thisDir->canonicalPath()+"/"+filename; |
447 | 447 | ||
448 | QFile f(destFile); | 448 | QFile f(destFile); |
449 | if( f.exists()) | 449 | if( f.exists()) |
450 | { | 450 | { |
451 | switch (QMessageBox::warning(this,tr("Delete"), | 451 | switch (QMessageBox::warning(this,tr("Delete"), |
452 | destFile+tr(" already exists.\nDo you really want to delete it?"), | 452 | destFile+tr(" already exists.\nDo you really want to delete it?"), |
453 | tr("Yes"),tr("No"),0,0,1) ) { | 453 | tr("Yes"),tr("No"),0,0,1) ) { |
454 | case 0: | 454 | case 0: |
455 | 455 | ||
456 | f.remove(); | 456 | f.remove(); |
457 | break; | 457 | break; |
458 | case 1: | 458 | case 1: |
459 | return; | 459 | return; |
460 | break; | 460 | break; |
461 | }; | 461 | }; |
462 | } | 462 | } |
463 | if(!copyFile( curFile,destFile) ) | 463 | if(!copyFile( curFile,destFile) ) |
464 | { | 464 | { |
465 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 465 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
466 | +curFile +tr("to\n")+destFile); | 466 | +curFile +tr("to\n")+destFile); |
467 | return; | 467 | return; |
468 | } | 468 | } |
469 | 469 | ||
470 | qDebug("copy "+curFile+" as "+destFile); | 470 | qDebug("copy "+curFile+" as "+destFile); |
471 | } | 471 | } |
472 | delete fileDlg; | 472 | delete fileDlg; |
473 | } | 473 | } |
474 | populateView(); | 474 | populateView(); |
475 | } | 475 | } |
476 | 476 | ||
477 | void AdvancedFm::move() | 477 | void AdvancedFm::move() |
478 | { | 478 | { |
479 | qApp->processEvents(); | 479 | qApp->processEvents(); |
480 | 480 | ||
481 | QStringList curFileList = getPath(); | 481 | QStringList curFileList = getPath(); |
482 | if( curFileList.count() > 0) | 482 | if( curFileList.count() > 0) |
483 | { | 483 | { |
484 | QString curFile, destFile, item; | 484 | QString curFile, destFile, item; |
485 | 485 | ||
486 | QDir *thisDir = CurrentDir(); | 486 | QDir *thisDir = CurrentDir(); |
487 | QDir *thatDir = OtherDir(); | 487 | QDir *thatDir = OtherDir(); |
488 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 488 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
489 | { | 489 | { |
490 | item=(*it); | 490 | item=(*it); |
491 | QString destFile = thatDir->canonicalPath(); | 491 | QString destFile = thatDir->canonicalPath(); |
492 | 492 | ||
493 | if(destFile.right(1).find("/",0,TRUE) == -1) | 493 | if(destFile.right(1).find("/",0,TRUE) == -1) |
494 | destFile+="/"; | 494 | destFile+="/"; |
495 | destFile += item; | 495 | destFile += item; |
496 | qDebug("Destination file is "+destFile); | 496 | qDebug("Destination file is "+destFile); |
497 | 497 | ||
498 | curFile = thisDir->canonicalPath(); | 498 | curFile = thisDir->canonicalPath(); |
499 | if(curFile.right(1).find("/",0,TRUE) == -1) | 499 | if(curFile.right(1).find("/",0,TRUE) == -1) |
500 | curFile +="/"; | 500 | curFile +="/"; |
501 | curFile+= item; | 501 | curFile+= item; |
502 | qDebug("CurrentFile file is " + curFile); | 502 | qDebug("CurrentFile file is " + curFile); |
503 | 503 | ||
504 | QFile f( curFile); | 504 | QFile f( curFile); |
505 | if( f.exists()) { | 505 | if( f.exists()) { |
506 | if( !copyFile( curFile, destFile) ) | 506 | if( !copyFile( curFile, destFile) ) |
507 | { | 507 | { |
508 | QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); | 508 | QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); |
509 | return; | 509 | return; |
510 | } else | 510 | } else |
511 | QFile::remove(curFile); | 511 | QFile::remove(curFile); |
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
515 | } | 515 | } |
516 | setOtherTabCurrent(); | 516 | setOtherTabCurrent(); |
517 | populateView(); | 517 | populateView(); |
518 | // populateLocalView(); | 518 | // populateLocalView(); |
519 | } | 519 | } |
520 | 520 | ||
521 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | 521 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) |
522 | { | 522 | { |
523 | char bf[ 50000 ]; | 523 | char bf[ 50000 ]; |
524 | int bytesRead; | 524 | int bytesRead; |
525 | bool success = TRUE; | 525 | bool success = TRUE; |
526 | struct stat status; | 526 | struct stat status; |
527 | 527 | ||
528 | QFile s( src ); | 528 | QFile s( src ); |
529 | QFile d( dest ); | 529 | QFile d( dest ); |
530 | 530 | ||
531 | if( s.open( IO_ReadOnly | IO_Raw ) && d.open( IO_WriteOnly | IO_Raw ) ) | 531 | if( s.open( IO_ReadOnly | IO_Raw ) && d.open( IO_WriteOnly | IO_Raw ) ) |
532 | { | 532 | { |
533 | while( (bytesRead = s.readBlock( bf, sizeof( bf ) )) == sizeof( bf ) ) | 533 | while( (bytesRead = s.readBlock( bf, sizeof( bf ) )) == sizeof( bf ) ) |
534 | { | 534 | { |
535 | if( d.writeBlock( bf, sizeof( bf ) ) != sizeof( bf ) ){ | 535 | if( d.writeBlock( bf, sizeof( bf ) ) != sizeof( bf ) ){ |
536 | success = FALSE; | 536 | success = FALSE; |
537 | break; | 537 | break; |
538 | } | 538 | } |
539 | } | 539 | } |
540 | if( success && (bytesRead > 0) ) | 540 | if( success && (bytesRead > 0) ) |
541 | { | 541 | { |
542 | d.writeBlock( bf, bytesRead ); | 542 | d.writeBlock( bf, bytesRead ); |
543 | } | 543 | } |
544 | } | 544 | } |
545 | else | 545 | else |
546 | { | 546 | { |
547 | success = FALSE; | 547 | success = FALSE; |
548 | } | 548 | } |
549 | 549 | ||
550 | // Set file permissions | 550 | // Set file permissions |
551 | if( stat( (const char *) src, &status ) == 0 ) | 551 | if( stat( (const char *) src, &status ) == 0 ) |
552 | { | 552 | { |
553 | chmod( (const char *) dest, status.st_mode ); | 553 | chmod( (const char *) dest, status.st_mode ); |
554 | } | 554 | } |
555 | 555 | ||
556 | return success; | 556 | return success; |
557 | } | 557 | } |
558 | 558 | ||
559 | void AdvancedFm::runCommand() | 559 | void AdvancedFm::runCommand() |
560 | { | 560 | { |
561 | QDir *thisDir = CurrentDir(); | 561 | QDir *thisDir = CurrentDir(); |
562 | |||
563 | QString curFile; | ||
564 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); | ||
565 | 562 | ||
566 | InputDialog *fileDlg; | 563 | QString curFile; |
567 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 564 | curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); |
568 | fileDlg->setInputText(curFile); | ||
569 | fileDlg->exec(); | ||
570 | //QString command; | ||
571 | 565 | ||
572 | if( fileDlg->result() == 1 ) | 566 | InputDialog *fileDlg; |
573 | { | 567 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
574 | qDebug(fileDlg->LineEdit1->text()); | 568 | fileDlg->setInputText(curFile); |
575 | QStringList command; | 569 | fileDlg->exec(); |
570 | //QString command; | ||
576 | 571 | ||
577 | command << "/bin/sh"; | 572 | if( fileDlg->result() == 1 ) |
578 | command << "-c"; | 573 | { |
579 | command << fileDlg->LineEdit1->text(); | 574 | qDebug(fileDlg->LineEdit1->text()); |
580 | Output *outDlg; | 575 | QStringList command; |
581 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 576 | |
582 | outDlg->showMaximized(); | 577 | command << "/bin/sh"; |
583 | outDlg->exec(); | 578 | command << "-c"; |
584 | qApp->processEvents(); | 579 | command << fileDlg->LineEdit1->text(); |
580 | Output *outDlg; | ||
581 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | ||
582 | outDlg->showMaximized(); | ||
583 | outDlg->exec(); | ||
584 | qApp->processEvents(); | ||
585 | 585 | ||
586 | } | 586 | } |
587 | } | 587 | } |
588 | 588 | ||
589 | void AdvancedFm::runCommandStd() | 589 | void AdvancedFm::runCommandStd() |
590 | { | 590 | { |
591 | QString curFile; | 591 | QString curFile; |
592 | QDir *thisDir = CurrentDir(); | 592 | QDir *thisDir = CurrentDir(); |
593 | QListView *thisView = CurrentView(); | 593 | QListView *thisView = CurrentView(); |
594 | if( thisView->currentItem()) | 594 | if( thisView->currentItem()) |
595 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); | 595 | curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); |
596 | 596 | ||
597 | InputDialog *fileDlg; | 597 | InputDialog *fileDlg; |
598 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 598 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
599 | fileDlg->setInputText(curFile); | 599 | fileDlg->setInputText(curFile); |
600 | fileDlg->exec(); | 600 | fileDlg->exec(); |
601 | 601 | ||
602 | if( fileDlg->result() == 1 ) | 602 | if( fileDlg->result() == 1 ) |
603 | { | 603 | { |
604 | qApp->processEvents(); | 604 | qApp->processEvents(); |
605 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); | 605 | startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); |
606 | } | 606 | } |
607 | } | 607 | } |
608 | 608 | ||
609 | void AdvancedFm::fileStatus() | 609 | void AdvancedFm::fileStatus() |
610 | { | 610 | { |
611 | QString curFile; | 611 | QString curFile; |
612 | curFile = CurrentView()->currentItem()->text(0); | 612 | curFile = CurrentView()->currentItem()->text(0); |
613 | 613 | ||
614 | QStringList command; | 614 | QStringList command; |
615 | command << "/bin/sh"; | 615 | command << "/bin/sh"; |
616 | command << "-c"; | 616 | command << "-c"; |
617 | command << "stat -l "+ curFile; | 617 | command << "stat -l "+ curFile; |
618 | 618 | ||
619 | Output *outDlg; | 619 | Output *outDlg; |
620 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 620 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
621 | outDlg->showMaximized(); | 621 | outDlg->showMaximized(); |
622 | outDlg->exec(); | 622 | outDlg->exec(); |
623 | qApp->processEvents(); | 623 | qApp->processEvents(); |
624 | } | 624 | } |
625 | 625 | ||
626 | 626 | ||
627 | void AdvancedFm::mkDir() | 627 | void AdvancedFm::mkDir() |
628 | { | 628 | { |
629 | makeDir(); | 629 | makeDir(); |
630 | } | 630 | } |
631 | 631 | ||
632 | void AdvancedFm::rn() | 632 | void AdvancedFm::rn() |
633 | { | 633 | { |
634 | renameIt(); | 634 | renameIt(); |
635 | } | 635 | } |
636 | 636 | ||
637 | void AdvancedFm::del() | 637 | void AdvancedFm::del() |
638 | { | 638 | { |
639 | doDelete(); | 639 | doDelete(); |
640 | } | 640 | } |
641 | 641 | ||
642 | void AdvancedFm::mkSym() | 642 | void AdvancedFm::mkSym() |
643 | { | 643 | { |
644 | QString cmd; | 644 | QString cmd; |
645 | QStringList curFileList = getPath(); | 645 | QStringList curFileList = getPath(); |
646 | if( curFileList.count() > 0) | 646 | if( curFileList.count() > 0) |
647 | { | 647 | { |
648 | QDir *thisDir = CurrentDir(); | 648 | QDir *thisDir = CurrentDir(); |
649 | QDir * thatDir = OtherDir(); | 649 | QDir * thatDir = OtherDir(); |
650 | 650 | ||
651 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 651 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
652 | { | 652 | { |
653 | 653 | ||
654 | QString destName = thatDir->canonicalPath()+"/"+(*it); | 654 | QString destName = thatDir->canonicalPath()+"/"+(*it); |
655 | if(destName.right(1) == "/") | 655 | if(destName.right(1) == "/") |
656 | { | 656 | { |
657 | destName = destName.left( destName.length() -1); | 657 | destName = destName.left( destName.length() -1); |
658 | } | 658 | } |
659 | 659 | ||
660 | QString curFile = thisDir->canonicalPath()+"/"+(*it); | 660 | QString curFile = thisDir->canonicalPath()+"/"+(*it); |
661 | 661 | ||
662 | if( curFile.right(1) == "/") | 662 | if( curFile.right(1) == "/") |
663 | { | 663 | { |
664 | curFile = curFile.left( curFile.length() -1); | 664 | curFile = curFile.left( curFile.length() -1); |
665 | } | 665 | } |
666 | 666 | ||
667 | cmd = "ln -s "+curFile+" "+destName; | 667 | cmd = "ln -s "+curFile+" "+destName; |
668 | qDebug(cmd); | 668 | qDebug(cmd); |
669 | startProcess( (const QString)cmd ); | 669 | startProcess( (const QString)cmd ); |
670 | } | 670 | } |
671 | setOtherTabCurrent(); | 671 | setOtherTabCurrent(); |
672 | populateView(); | 672 | populateView(); |
673 | } | 673 | } |
674 | } | 674 | } |
675 | 675 | ||
676 | void AdvancedFm::doBeam() | 676 | void AdvancedFm::doBeam() |
677 | { | 677 | { |
678 | Ir ir; | 678 | Ir ir; |
679 | if(!ir.supported()) | 679 | if(!ir.supported()) |
680 | { | 680 | { |
681 | } | 681 | } |
682 | else | 682 | else |
683 | { | 683 | { |
684 | QStringList curFileList = getPath(); | 684 | QStringList curFileList = getPath(); |
685 | if( curFileList.count() > 0) | 685 | if( curFileList.count() > 0) |
686 | { | 686 | { |
687 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 687 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
688 | { | 688 | { |
689 | 689 | ||
690 | QString curFile = CurrentDir()->canonicalPath()+"/"+(*it); | 690 | QString curFile = CurrentDir()->canonicalPath()+"/"+(*it); |
691 | if( curFile.right(1) == "/") | 691 | if( curFile.right(1) == "/") |
692 | { | 692 | { |
693 | curFile = curFile.left( curFile.length() -1); | 693 | curFile = curFile.left( curFile.length() -1); |
694 | } | 694 | } |
695 | Ir *file = new Ir(this, "IR"); | 695 | Ir *file = new Ir(this, "IR"); |
696 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); | 696 | connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); |
697 | file->send( curFile, curFile ); | 697 | file->send( curFile, curFile ); |
698 | } | 698 | } |
699 | } | 699 | } |
700 | } | 700 | } |
701 | 701 | ||
702 | } | 702 | } |
703 | 703 | ||
704 | void AdvancedFm::fileBeamFinished( Ir *) | 704 | void AdvancedFm::fileBeamFinished( Ir *) |
705 | { | 705 | { |
706 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); | 706 | QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); |
707 | } | 707 | } |
708 | 708 | ||
709 | void AdvancedFm::selectAll() | 709 | void AdvancedFm::selectAll() |
710 | { | 710 | { |
711 | // if (TabWidget->getCurrentTab() == 0) { | 711 | // if (TabWidget->getCurrentTab() == 0) { |
712 | QListView *thisView = CurrentView(); | 712 | QListView *thisView = CurrentView(); |
713 | thisView->selectAll(true); | 713 | thisView->selectAll(true); |
714 | thisView->setSelected( thisView->firstChild(),false); | 714 | thisView->setSelected( thisView->firstChild(),false); |
715 | // } else { | 715 | // } else { |
716 | // Remote_View->selectAll(true); | 716 | // Remote_View->selectAll(true); |
717 | // Remote_View->setSelected( Remote_View->firstChild(),false); | 717 | // Remote_View->setSelected( Remote_View->firstChild(),false); |
718 | // } | 718 | // } |
719 | } | 719 | } |
720 | 720 | ||
721 | void AdvancedFm::startProcess(const QString & cmd) | 721 | void AdvancedFm::startProcess(const QString & cmd) |
722 | { | 722 | { |
723 | QStringList command; | 723 | QStringList command; |
724 | OProcess *process; | 724 | OProcess *process; |
725 | process = new OProcess(); | 725 | process = new OProcess(); |
726 | connect(process, SIGNAL(processExited(OProcess *)), | 726 | connect(process, SIGNAL(processExited(OProcess *)), |
727 | this, SLOT( processEnded())); | 727 | this, SLOT( processEnded(OProcess *))); |
728 | |||
729 | connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)), | ||
730 | this, SLOT( oprocessStderr(OProcess *, char *, int))); | ||
728 | 731 | ||
729 | command << "/bin/sh"; | 732 | command << "/bin/sh"; |
730 | command << "-c"; | 733 | command << "-c"; |
731 | command << cmd.latin1(); | 734 | command << cmd.latin1(); |
732 | *process << command; | 735 | *process << command; |
733 | if(!process->start(OProcess::NotifyOnExit) ) | 736 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
734 | qDebug("could not start process"); | 737 | qDebug("could not start process"); |
735 | } | 738 | } |
736 | 739 | ||
737 | void AdvancedFm::processEnded() | 740 | void AdvancedFm::processEnded(OProcess *) |
738 | { | 741 | { |
739 | // populateLocalView(); | 742 | // populateLocalView(); |
740 | populateView(); | 743 | populateView(); |
741 | } | 744 | } |
742 | 745 | ||
746 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int buflen) { | ||
747 | qWarning("received stderrt %d bytes", buflen); | ||
748 | |||
749 | QString lineStr = buffer; | ||
750 | // lineStr=lineStr.left(lineStr.length()-1); | ||
751 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | ||
752 | |||
753 | // OutputEdit->append(lineStr); | ||
754 | // OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | ||
755 | } | ||
756 | |||
743 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | 757 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) |
744 | { | 758 | { |
745 | if ( o->inherits( "QLineEdit" ) ) | 759 | if ( o->inherits( "QLineEdit" ) ) |
746 | { | 760 | { |
747 | if ( e->type() == QEvent::KeyPress ) | 761 | if ( e->type() == QEvent::KeyPress ) |
748 | { | 762 | { |
749 | QKeyEvent *ke = (QKeyEvent*)e; | 763 | QKeyEvent *ke = (QKeyEvent*)e; |
750 | if ( ke->key() == Key_Return || | 764 | if ( ke->key() == Key_Return || |
751 | ke->key() == Key_Enter ) | 765 | ke->key() == Key_Enter ) |
752 | { | 766 | { |
753 | okRename(); | 767 | okRename(); |
754 | return true; | 768 | return true; |
755 | } | 769 | } |
756 | else if ( ke->key() == Key_Escape ) | 770 | else if ( ke->key() == Key_Escape ) |
757 | { | 771 | { |
758 | cancelRename(); | 772 | cancelRename(); |
759 | return true; | 773 | return true; |
760 | } | 774 | } |
761 | } | 775 | } |
762 | else if ( e->type() == QEvent::FocusOut ) | 776 | else if ( e->type() == QEvent::FocusOut ) |
763 | { | 777 | { |
764 | cancelRename(); | 778 | cancelRename(); |
765 | return true; | 779 | return true; |
766 | } | 780 | } |
767 | } | 781 | } |
768 | if ( o->inherits( "QListView" ) ) | 782 | if ( o->inherits( "QListView" ) ) |
769 | { | 783 | { |
770 | if ( e->type() == QEvent::FocusOut ) | 784 | if ( e->type() == QEvent::FocusOut ) |
771 | { | 785 | { |
772 | printf("focusIn\n"); | 786 | printf("focusIn\n"); |
773 | 787 | ||
774 | } | 788 | } |
775 | } | 789 | } |
776 | 790 | ||
777 | return QWidget::eventFilter( o, e ); | 791 | return QWidget::eventFilter( o, e ); |
778 | } | 792 | } |
779 | 793 | ||
780 | 794 | ||
781 | void AdvancedFm::cancelRename() | 795 | void AdvancedFm::cancelRename() |
782 | { | 796 | { |
783 | qDebug("cancel rename"); | 797 | qDebug("cancel rename"); |
784 | QListView * view; | 798 | QListView * view; |
785 | view = CurrentView(); | 799 | view = CurrentView(); |
786 | 800 | ||
787 | bool resetFocus = view->viewport()->focusProxy() == renameBox; | 801 | bool resetFocus = view->viewport()->focusProxy() == renameBox; |
788 | delete renameBox; | 802 | delete renameBox; |
789 | renameBox = 0; | 803 | renameBox = 0; |
790 | if ( resetFocus ) | 804 | if ( resetFocus ) |
791 | { | 805 | { |
792 | view->viewport()->setFocusProxy( view); | 806 | view->viewport()->setFocusProxy( view); |
793 | view->setFocus(); | 807 | view->setFocus(); |
794 | } | 808 | } |
795 | } | 809 | } |
796 | 810 | ||
797 | void AdvancedFm::doRename(QListView * view) | 811 | void AdvancedFm::doRename(QListView * view) |
798 | { | 812 | { |
799 | 813 | ||
800 | QRect r = view->itemRect( view->currentItem( )); | 814 | QRect r = view->itemRect( view->currentItem( )); |
801 | r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); | 815 | r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); |
802 | r.setX( view->contentsX() ); | 816 | r.setX( view->contentsX() ); |
803 | if ( r.width() > view->visibleWidth() ) | 817 | if ( r.width() > view->visibleWidth() ) |
804 | r.setWidth( view->visibleWidth() ); | 818 | r.setWidth( view->visibleWidth() ); |
805 | 819 | ||
806 | renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); | 820 | renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); |
807 | renameBox->setFrame(true); | 821 | renameBox->setFrame(true); |
808 | 822 | ||
809 | renameBox->setText( view->currentItem()->text(0) ); | 823 | renameBox->setText( view->currentItem()->text(0) ); |
810 | 824 | ||
811 | renameBox->selectAll(); | 825 | renameBox->selectAll(); |
812 | renameBox->installEventFilter( this ); | 826 | renameBox->installEventFilter( this ); |
813 | view->addChild( renameBox, r.x(), r.y() ); | 827 | view->addChild( renameBox, r.x(), r.y() ); |
814 | renameBox->resize( r.size() ); | 828 | renameBox->resize( r.size() ); |
815 | view->viewport()->setFocusProxy( renameBox ); | 829 | view->viewport()->setFocusProxy( renameBox ); |
816 | renameBox->setFocus(); | 830 | renameBox->setFocus(); |
817 | renameBox->show(); | 831 | renameBox->show(); |
818 | 832 | ||
819 | } | 833 | } |
820 | 834 | ||
821 | 835 | ||
822 | void AdvancedFm::renameIt() | 836 | void AdvancedFm::renameIt() |
823 | { | 837 | { |
824 | QListView *thisView = CurrentView(); | 838 | QListView *thisView = CurrentView(); |
825 | oldName = thisView->currentItem()->text(0); | 839 | oldName = thisView->currentItem()->text(0); |
826 | doRename( thisView ); | 840 | doRename( thisView ); |
827 | populateView(); | 841 | populateView(); |
828 | } | 842 | } |
829 | 843 | ||
830 | void AdvancedFm::okRename() | 844 | void AdvancedFm::okRename() |
831 | { | 845 | { |
832 | QString newName = renameBox->text(); | 846 | QString newName = renameBox->text(); |
833 | cancelRename(); | 847 | cancelRename(); |
834 | //int tabs=0; | 848 | // int tabs=0; |
835 | QListView * view = CurrentView(); | 849 | QListView * view = CurrentView(); |
836 | QString path = CurrentDir()->canonicalPath() + "/"; | 850 | QString path = CurrentDir()->canonicalPath() + "/"; |
837 | oldName = path + oldName; | 851 | oldName = path + oldName; |
838 | newName = path + newName; | 852 | newName = path + newName; |
839 | 853 | ||
840 | if( view->currentItem() == NULL) | 854 | if( view->currentItem() == NULL) |
841 | return; | 855 | return; |
842 | if( rename( oldName.latin1(), newName.latin1())== -1) | 856 | if( rename( oldName.latin1(), newName.latin1())== -1) |
843 | QMessageBox::message(tr("Note"),tr("Could not rename")); | 857 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
844 | else | 858 | else |
845 | oldName = ""; | 859 | oldName = ""; |
846 | 860 | ||
847 | view->takeItem( view->currentItem() ); | 861 | view->takeItem( view->currentItem() ); |
848 | delete view->currentItem(); | 862 | delete view->currentItem(); |
849 | populateView(); | 863 | populateView(); |
850 | } | 864 | } |