-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 7 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 220 |
4 files changed, 108 insertions, 122 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 9721f84..6f017b4 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -300,55 +300,48 @@ void AdvancedFm::currentPathComboChanged() { | |||
300 | QMessageBox::message(tr("Note"),tr("<p>That directory does not exist</p>")); | 300 | QMessageBox::message(tr("Note"),tr("<p>That directory does not exist</p>")); |
301 | } | 301 | } |
302 | } | 302 | } |
303 | 303 | ||
304 | void AdvancedFm::fillCombo(const QString ¤tPath) { | 304 | void AdvancedFm::fillCombo(const QString ¤tPath) { |
305 | 305 | ||
306 | if ( TabWidget->currentWidget() == tab) { | 306 | if ( TabWidget->currentWidget() == tab) { |
307 | // if ( whichTab == 1) { | 307 | // if ( whichTab == 1) { |
308 | currentPathCombo->lineEdit()->setText( currentPath); | 308 | currentPathCombo->lineEdit()->setText( currentPath); |
309 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 309 | if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
310 | currentPathCombo->clear(); | 310 | currentPathCombo->clear(); |
311 | localDirPathStringList.prepend( currentPath ); | 311 | localDirPathStringList.prepend( currentPath ); |
312 | currentPathCombo->insertStringList( localDirPathStringList,-1); | 312 | currentPathCombo->insertStringList( localDirPathStringList,-1); |
313 | } | 313 | } |
314 | } else { | 314 | } else { |
315 | currentPathCombo->lineEdit()->setText( currentPath); | 315 | currentPathCombo->lineEdit()->setText( currentPath); |
316 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { | 316 | if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { |
317 | currentPathCombo->clear(); | 317 | currentPathCombo->clear(); |
318 | remoteDirPathStringList.prepend( currentPath ); | 318 | remoteDirPathStringList.prepend( currentPath ); |
319 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); | 319 | currentPathCombo->insertStringList( remoteDirPathStringList,-1); |
320 | } | 320 | } |
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
324 | void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | ||
325 | chdir( currentPath.latin1() ); | ||
326 | CurrentDir()->cd( currentPath, TRUE); | ||
327 | populateView(); | ||
328 | update(); | ||
329 | } | ||
330 | |||
331 | QStringList AdvancedFm::getPath() { | 324 | QStringList AdvancedFm::getPath() { |
332 | QStringList strList; | 325 | QStringList strList; |
333 | QListView *thisView=CurrentView(); | 326 | QListView *thisView=CurrentView(); |
334 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); | 327 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); |
335 | QListViewItemIterator it( thisView ); | 328 | QListViewItemIterator it( thisView ); |
336 | for ( ; it.current(); ++it ) { | 329 | for ( ; it.current(); ++it ) { |
337 | if ( it.current()->isSelected() ) { | 330 | if ( it.current()->isSelected() ) { |
338 | strList << it.current()->text(0); | 331 | strList << it.current()->text(0); |
339 | // odebug << it.current()->text(0) << oendl; | 332 | // odebug << it.current()->text(0) << oendl; |
340 | } | 333 | } |
341 | } | 334 | } |
342 | return strList; | 335 | return strList; |
343 | } | 336 | } |
344 | 337 | ||
345 | void AdvancedFm::changeTo(const QString dir) { | 338 | void AdvancedFm::changeTo(const QString dir) { |
346 | chdir( dir.latin1()); | 339 | chdir( dir.latin1()); |
347 | CurrentDir()->cd(dir, TRUE); | 340 | CurrentDir()->cd(dir, TRUE); |
348 | populateView(); | 341 | populateView(); |
349 | update(); | 342 | update(); |
350 | } | 343 | } |
351 | 344 | ||
352 | void AdvancedFm::homeButtonPushed() { | 345 | void AdvancedFm::homeButtonPushed() { |
353 | changeTo(QDir::homeDirPath()); | 346 | changeTo(QDir::homeDirPath()); |
354 | } | 347 | } |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 00ab909..6f7eb96 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -132,49 +132,48 @@ protected slots: | |||
132 | void switchToLocalTab(); | 132 | void switchToLocalTab(); |
133 | void switchToRemoteTab(); | 133 | void switchToRemoteTab(); |
134 | void refreshCurrentTab(); | 134 | void refreshCurrentTab(); |
135 | 135 | ||
136 | void openSearch(); | 136 | void openSearch(); |
137 | void dirMenuSelected(int); | 137 | void dirMenuSelected(int); |
138 | void showFileMenu(); | 138 | void showFileMenu(); |
139 | void homeButtonPushed(); | 139 | void homeButtonPushed(); |
140 | void docButtonPushed(); | 140 | void docButtonPushed(); |
141 | void SDButtonPushed(); | 141 | void SDButtonPushed(); |
142 | void CFButtonPushed(); | 142 | void CFButtonPushed(); |
143 | void QPEButtonPushed(); | 143 | void QPEButtonPushed(); |
144 | void upDir(); | 144 | void upDir(); |
145 | void currentPathComboChanged(); | 145 | void currentPathComboChanged(); |
146 | 146 | ||
147 | void copy(); | 147 | void copy(); |
148 | void copyTimer(); | 148 | void copyTimer(); |
149 | void copyAs(); | 149 | void copyAs(); |
150 | void copyAsTimer(); | 150 | void copyAsTimer(); |
151 | void copySameDir(); | 151 | void copySameDir(); |
152 | void copySameDirTimer(); | 152 | void copySameDirTimer(); |
153 | void move(); | 153 | void move(); |
154 | void moveTimer(); | 154 | void moveTimer(); |
155 | 155 | ||
156 | void currentPathComboActivated(const QString &); | ||
157 | void fillCombo(const QString &); | 156 | void fillCombo(const QString &); |
158 | bool copyFile( const QString & , const QString & ); | 157 | bool copyFile( const QString & , const QString & ); |
159 | void fileStatus(); | 158 | void fileStatus(); |
160 | void doAbout(); | 159 | void doAbout(); |
161 | void doBeam(); | 160 | void doBeam(); |
162 | void fileBeamFinished( Ir *); | 161 | void fileBeamFinished( Ir *); |
163 | bool copyDirectory( const QString & , const QString & ); | 162 | bool copyDirectory( const QString & , const QString & ); |
164 | // void navigateToSelected(); | 163 | // void navigateToSelected(); |
165 | bool moveDirectory( const QString & , const QString & ); | 164 | bool moveDirectory( const QString & , const QString & ); |
166 | 165 | ||
167 | // void slotSwitchtoLocal(int); | 166 | // void slotSwitchtoLocal(int); |
168 | 167 | ||
169 | private: | 168 | private: |
170 | MenuButton *menuButton; | 169 | MenuButton *menuButton; |
171 | QString oldName, localViewDir, remoteViewDir; | 170 | QString oldName, localViewDir, remoteViewDir; |
172 | void startProcess(const QString &); | 171 | void startProcess(const QString &); |
173 | bool eventFilter( QObject * , QEvent * ); | 172 | bool eventFilter( QObject * , QEvent * ); |
174 | void cancelRename(); | 173 | void cancelRename(); |
175 | void doRename(QListView *); | 174 | void doRename(QListView *); |
176 | void okRename(); | 175 | void okRename(); |
177 | void customDirsToMenu(); | 176 | void customDirsToMenu(); |
178 | void addCustomDir(); | 177 | void addCustomDir(); |
179 | void removeCustomDir(); | 178 | void removeCustomDir(); |
180 | void navigateToSelected(); | 179 | void navigateToSelected(); |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index fe565a0..1047c5a 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -234,47 +234,47 @@ void AdvancedFm::init() { | |||
234 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 234 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
235 | currentDir.setPath( QDir::currentDirPath()); | 235 | currentDir.setPath( QDir::currentDirPath()); |
236 | 236 | ||
237 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 237 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
238 | currentRemoteDir.setPath( QDir::currentDirPath()); | 238 | currentRemoteDir.setPath( QDir::currentDirPath()); |
239 | 239 | ||
240 | // b = TRUE; | 240 | // b = TRUE; |
241 | 241 | ||
242 | filterStr="*"; | 242 | filterStr="*"; |
243 | showMenuHidden(); | 243 | showMenuHidden(); |
244 | TabWidget->setCurrentWidget(0); | 244 | TabWidget->setCurrentWidget(0); |
245 | 245 | ||
246 | } | 246 | } |
247 | 247 | ||
248 | void AdvancedFm::initConnections() | 248 | void AdvancedFm::initConnections() |
249 | { | 249 | { |
250 | 250 | ||
251 | connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(cleanUp())); | 251 | connect(qApp,SIGNAL(aboutToQuit()),this,SLOT(cleanUp())); |
252 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); | 252 | connect( qpeDirButton ,SIGNAL(released()),this,SLOT( QPEButtonPushed()) ); |
253 | connect( cfButton ,SIGNAL(released()), this,SLOT( CFButtonPushed()) ); | 253 | connect( cfButton ,SIGNAL(released()), this,SLOT( CFButtonPushed()) ); |
254 | connect( sdButton ,SIGNAL(released()), this,SLOT( SDButtonPushed()) ); | 254 | connect( sdButton ,SIGNAL(released()), this,SLOT( SDButtonPushed()) ); |
255 | connect( cdUpButton ,SIGNAL(released()), this,SLOT( upDir()) ); | 255 | connect( cdUpButton ,SIGNAL(released()), this,SLOT( upDir()) ); |
256 | connect( docButton,SIGNAL(released()), this,SLOT( docButtonPushed()) ); | 256 | connect( docButton,SIGNAL(released()), this,SLOT( docButtonPushed()) ); |
257 | connect( homeButton,SIGNAL(released()), this,SLOT( homeButtonPushed()) ); | 257 | connect( homeButton,SIGNAL(released()), this,SLOT( homeButtonPushed()) ); |
258 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), this, SLOT( currentPathComboActivated(const QString&) ) ); | 258 | connect( currentPathCombo, SIGNAL( activated(const QString&) ), this, SLOT( changeTo(const QString&) ) ); |
259 | 259 | ||
260 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), this,SLOT(currentPathComboChanged())); | 260 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), this,SLOT(currentPathComboChanged())); |
261 | 261 | ||
262 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); | 262 | connect( Local_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); |
263 | 263 | ||
264 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 264 | connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
265 | 265 | ||
266 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); | 266 | connect( Remote_View, SIGNAL( clicked(QListViewItem*)), this,SLOT( ListClicked(QListViewItem*)) ); |
267 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); | 267 | connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)), this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) ); |
268 | 268 | ||
269 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), this,SLOT(tabChanged(QWidget*))); | 269 | connect( TabWidget,SIGNAL(currentChanged(QWidget*)), this,SLOT(tabChanged(QWidget*))); |
270 | 270 | ||
271 | connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), this, SLOT(showFileMenu())); | 271 | connect( Remote_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)), this, SLOT(showFileMenu())); |
272 | connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), this, SLOT(showFileMenu())); | 272 | connect( Local_View, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&,int)), this, SLOT(showFileMenu())); |
273 | 273 | ||
274 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); | 274 | connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&))); |
275 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); | 275 | // connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int))); |
276 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); | 276 | connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int))); |
277 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); | 277 | // connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); |
278 | 278 | ||
279 | } | 279 | } |
280 | 280 | ||
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 706658e..7b3dcf6 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -29,135 +29,135 @@ using namespace Opie::Core; | |||
29 | 29 | ||
30 | /* STD */ | 30 | /* STD */ |
31 | 31 | ||
32 | #include <errno.h> | 32 | #include <errno.h> |
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | #include <unistd.h> | 34 | #include <unistd.h> |
35 | #include <sys/stat.h> | 35 | #include <sys/stat.h> |
36 | #include <dirent.h> | 36 | #include <dirent.h> |
37 | #include <sys/sendfile.h> | 37 | #include <sys/sendfile.h> |
38 | #include <fcntl.h> | 38 | #include <fcntl.h> |
39 | 39 | ||
40 | void AdvancedFm::doDirChange() { | 40 | void AdvancedFm::doDirChange() { |
41 | QString pathItem = CurrentView()->currentItem()->text(0); | 41 | QString pathItem = CurrentView()->currentItem()->text(0); |
42 | if( pathItem == "../") { | 42 | if( pathItem == "../") { |
43 | ListClicked( CurrentView()->currentItem()); | 43 | ListClicked( CurrentView()->currentItem()); |
44 | } else { | 44 | } else { |
45 | if( pathItem.find(" -> ",0,TRUE) != -1) | 45 | if( pathItem.find(" -> ",0,TRUE) != -1) |
46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; | 46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; |
47 | // owarn << pathItem << oendl; | 47 | // owarn << pathItem << oendl; |
48 | changeTo( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); | 48 | changeTo( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | void AdvancedFm::showMenuHidden() { | 52 | void AdvancedFm::showMenuHidden() { |
53 | if (b) { | 53 | if (b) { |
54 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 54 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
55 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 55 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
56 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 56 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
57 | } else { | 57 | } else { |
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),FALSE); | 60 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
61 | } | 61 | } |
62 | b = !b; | 62 | b = !b; |
63 | populateView(); | 63 | populateView(); |
64 | } | 64 | } |
65 | 65 | ||
66 | void AdvancedFm::showHidden() { | 66 | void AdvancedFm::showHidden() { |
67 | if (b) { | 67 | if (b) { |
68 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 68 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
69 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 69 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
70 | } else { | 70 | } else { |
71 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 71 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
72 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 72 | OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
73 | } | 73 | } |
74 | populateView(); | 74 | populateView(); |
75 | } | 75 | } |
76 | 76 | ||
77 | QString AdvancedFm::dealWithSymName(const QString &fileName) { | 77 | QString AdvancedFm::dealWithSymName(const QString &fileName) { |
78 | QString strItem = fileName; | 78 | QString strItem = fileName; |
79 | return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 79 | return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
80 | } | 80 | } |
81 | 81 | ||
82 | void AdvancedFm::runThis() { | 82 | void AdvancedFm::runThis() { |
83 | if( !CurrentView()->currentItem()) return; | 83 | if( !CurrentView()->currentItem()) return; |
84 | QString fs; | 84 | QString fs; |
85 | QDir *thisDir = CurrentDir(); | 85 | QDir *thisDir = CurrentDir(); |
86 | 86 | ||
87 | QString curFile = CurrentView()->currentItem()->text(0); | 87 | QString curFile = CurrentView()->currentItem()->text(0); |
88 | QString path = thisDir->canonicalPath(); | 88 | QString path = thisDir->canonicalPath(); |
89 | 89 | ||
90 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 90 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
91 | 91 | ||
92 | curFile = dealWithSymName((const QString&)curFile); | 92 | curFile = dealWithSymName((const QString&)curFile); |
93 | 93 | ||
94 | if(curFile != "../") { | 94 | if(curFile != "../") { |
95 | 95 | ||
96 | fs = getFileSystemType((const QString &) path); | 96 | fs = getFileSystemType((const QString &) path); |
97 | QFileInfo fileInfo( path + "/" + curFile); | 97 | QFileInfo fileInfo( path + "/" + curFile); |
98 | // odebug << fileInfo.owner() << oendl; | 98 | // odebug << fileInfo.owner() << oendl; |
99 | 99 | ||
100 | if( (fileInfo.permission( QFileInfo::ExeUser) | 100 | if( (fileInfo.permission( QFileInfo::ExeUser) |
101 | | fileInfo.permission( QFileInfo::ExeGroup) | 101 | | fileInfo.permission( QFileInfo::ExeGroup) |
102 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { | 102 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { |
103 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { | 103 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { |
104 | QCopEnvelope e("QPE/System", "execute(QString)" ); | 104 | QCopEnvelope e("QPE/System", "execute(QString)" ); |
105 | e << curFile; | 105 | e << curFile; |
106 | } else { | 106 | } else { |
107 | curFile = path + "/" + curFile; | 107 | curFile = path + "/" + curFile; |
108 | DocLnk nf(curFile); | 108 | DocLnk nf(curFile); |
109 | QString execStr = nf.exec(); | 109 | QString execStr = nf.exec(); |
110 | // odebug << execStr << oendl; | 110 | // odebug << execStr << oendl; |
111 | if( execStr.isEmpty() ) { | 111 | if( execStr.isEmpty() ) { |
112 | } else { | 112 | } else { |
113 | nf.execute(); | 113 | nf.execute(); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | void AdvancedFm::runText() { | 119 | void AdvancedFm::runText() { |
120 | if( !CurrentView()->currentItem()) return; | 120 | if( !CurrentView()->currentItem()) return; |
121 | QString curFile = CurrentView()->currentItem()->text(0); | 121 | QString curFile = CurrentView()->currentItem()->text(0); |
122 | if(curFile != "../") { | 122 | if(curFile != "../") { |
123 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 123 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
124 | curFile = dealWithSymName((const QString&)curFile); | 124 | curFile = dealWithSymName((const QString&)curFile); |
125 | curFile = CurrentDir()->canonicalPath()+"/"+curFile; | 125 | curFile = CurrentDir()->canonicalPath()+"/"+curFile; |
126 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); | 126 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); |
127 | e << curFile; | 127 | e << curFile; |
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | void AdvancedFm::makeDir() { | 131 | void AdvancedFm::makeDir() { |
132 | InputDialog *fileDlg; | 132 | InputDialog *fileDlg; |
133 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 133 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
134 | fileDlg->exec(); | 134 | fileDlg->exec(); |
135 | if( fileDlg->result() == 1 ) { | 135 | if( fileDlg->result() == 1 ) { |
136 | QDir *thisDir = CurrentDir(); | 136 | QDir *thisDir = CurrentDir(); |
137 | QString filename = fileDlg->LineEdit1->text(); | 137 | QString filename = fileDlg->LineEdit1->text(); |
138 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); | 138 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); |
139 | } | 139 | } |
140 | populateView(); | 140 | populateView(); |
141 | } | 141 | } |
142 | 142 | ||
143 | void AdvancedFm::doDelete() { | 143 | void AdvancedFm::doDelete() { |
144 | QStringList curFileList = getPath(); | 144 | QStringList curFileList = getPath(); |
145 | bool doMsg=true; | 145 | bool doMsg=true; |
146 | int count = curFileList.count(); | 146 | int count = curFileList.count(); |
147 | if( count > 0) { | 147 | if( count > 0) { |
148 | if(count > 1 ) { | 148 | if(count > 1 ) { |
149 | QString msg; | 149 | QString msg; |
150 | msg=tr("<p>Really delete %1 files?</p>").arg(count); | 150 | msg=tr("<p>Really delete %1 files?</p>").arg(count); |
151 | switch ( QMessageBox::warning(this,tr("Delete"),msg | 151 | switch ( QMessageBox::warning(this,tr("Delete"),msg |
152 | ,tr("Yes"),tr("No"),0,0,1) ) | 152 | ,tr("Yes"),tr("No"),0,0,1) ) |
153 | { | 153 | { |
154 | case 0: | 154 | case 0: |
155 | doMsg=false; | 155 | doMsg=false; |
156 | break; | 156 | break; |
157 | case 1: | 157 | case 1: |
158 | return; | 158 | return; |
159 | break; | 159 | break; |
160 | }; | 160 | }; |
161 | } | 161 | } |
162 | 162 | ||
163 | QString myFile; | 163 | QString myFile; |
@@ -238,122 +238,116 @@ void AdvancedFm::filePerms() { | |||
238 | populateView(); | 238 | populateView(); |
239 | } | 239 | } |
240 | 240 | ||
241 | void AdvancedFm::doProperties() { | 241 | void AdvancedFm::doProperties() { |
242 | #if defined(QT_QWS_OPIE) | 242 | #if defined(QT_QWS_OPIE) |
243 | 243 | ||
244 | QStringList curFileList = getPath(); | 244 | QStringList curFileList = getPath(); |
245 | 245 | ||
246 | QString filePath; | 246 | QString filePath; |
247 | filePath = CurrentDir()->canonicalPath()+"/"; | 247 | filePath = CurrentDir()->canonicalPath()+"/"; |
248 | 248 | ||
249 | // odebug << "" << curFileList.count() << "" << oendl; | 249 | // odebug << "" << curFileList.count() << "" << oendl; |
250 | 250 | ||
251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
252 | // odebug << (filePath+*it) << oendl; | 252 | // odebug << (filePath+*it) << oendl; |
253 | DocLnk lnk( (filePath+*it)); | 253 | DocLnk lnk( (filePath+*it)); |
254 | LnkProperties prop( &lnk ); | 254 | LnkProperties prop( &lnk ); |
255 | QPEApplication::execDialog( &prop ); | 255 | QPEApplication::execDialog( &prop ); |
256 | } | 256 | } |
257 | #endif | 257 | #endif |
258 | 258 | ||
259 | } | 259 | } |
260 | 260 | ||
261 | void AdvancedFm::upDir() { | 261 | void AdvancedFm::upDir() { |
262 | QDir *thisDir = CurrentDir(); | ||
263 | QString current = thisDir->canonicalPath(); | ||
264 | QDir dir(current); | ||
265 | dir.cdUp(); | ||
266 | current = dir.canonicalPath(); | ||
267 | chdir( current.latin1() ); | ||
268 | thisDir->cd( current, TRUE); | ||
269 | 262 | ||
270 | populateView(); | 263 | QDir dir( CurrentDir()->canonicalPath()); |
271 | update(); | 264 | dir.cdUp(); |
265 | changeTo(dir.canonicalPath()); | ||
272 | } | 266 | } |
273 | 267 | ||
274 | void AdvancedFm::copyTimer() { | 268 | void AdvancedFm::copyTimer() { |
275 | QTimer::singleShot(125,this,SLOT(copy())); | 269 | QTimer::singleShot(125,this,SLOT(copy())); |
276 | } | 270 | } |
277 | 271 | ||
278 | void AdvancedFm::copy() { | 272 | void AdvancedFm::copy() { |
279 | QStringList curFileList = getPath(); | 273 | QStringList curFileList = getPath(); |
280 | |||
281 | QDir *thisDir = CurrentDir(); | ||
282 | QDir *thatDir = OtherDir(); | ||
283 | 274 | ||
284 | bool doMsg=true; | 275 | QDir *thisDir = CurrentDir(); |
285 | int count=curFileList.count(); | 276 | QDir *thatDir = OtherDir(); |
286 | if( count > 0) { | 277 | |
287 | if(count > 1 ){ | 278 | bool doMsg = true; |
288 | QString msg; | 279 | int count = curFileList.count(); |
289 | msg=tr("<p>Really copy %1 files?</p>").arg(count); | 280 | if( count > 0) { |
290 | switch ( QMessageBox::warning(this,tr("Copy"),msg | 281 | if(count > 1 ){ |
291 | ,tr("Yes"),tr("No"),0,0,1) ) | 282 | QString msg; |
292 | { | 283 | msg=tr("<p>Really copy %1 files?</p>").arg(count); |
293 | case 0: | 284 | switch ( QMessageBox::warning(this,tr("Copy"),msg |
294 | doMsg=false; | 285 | ,tr("Yes"),tr("No"),0,0,1) ) |
295 | break; | 286 | { |
296 | case 1: | 287 | case 0: |
297 | return; | 288 | doMsg=false; |
298 | break; | 289 | break; |
299 | }; | 290 | case 1: |
300 | } | 291 | return; |
292 | break; | ||
293 | }; | ||
294 | } | ||
301 | 295 | ||
302 | QString curFile, item, destFile; | 296 | QString curFile, item, destFile; |
303 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 297 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
304 | item=(*it); | 298 | item=(*it); |
305 | if(item.find("->",0,TRUE)) //symlink | 299 | if(item.find("->",0,TRUE)) //symlink |
306 | item = item.left(item.find("->",0,TRUE)); | 300 | item = item.left(item.find("->",0,TRUE)); |
307 | 301 | ||
308 | curFile = thisDir->canonicalPath()+"/"+ item; | 302 | curFile = thisDir->canonicalPath()+"/"+ item; |
309 | destFile = thatDir->canonicalPath()+"/"+ item; | 303 | destFile = thatDir->canonicalPath()+"/"+ item; |
310 | 304 | ||
311 | // odebug << "Destination file is "+destFile << oendl; | 305 | // odebug << "Destination file is "+destFile << oendl; |
312 | // odebug << "CurrentFile file is " + curFile << oendl; | 306 | // odebug << "CurrentFile file is " + curFile << oendl; |
313 | 307 | ||
314 | QFile f(destFile); | 308 | QFile f(destFile); |
315 | if( f.exists()) { | 309 | if( f.exists()) { |
316 | if(doMsg) { | 310 | if(doMsg) { |
317 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 311 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
318 | tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), | 312 | tr("<p>%1 already exists. Ok to overwrite?</P>").arg(item), |
319 | tr("Yes"),tr("No"),0,0,1)) { | 313 | tr("Yes"),tr("No"),0,0,1)) { |
320 | case 1: | 314 | case 1: |
321 | return; | 315 | return; |
322 | break; | 316 | break; |
323 | }; | 317 | }; |
324 | } | 318 | } |
325 | f.remove(); | 319 | f.remove(); |
326 | } | 320 | } |
327 | 321 | ||
328 | if( !copyFile( curFile, destFile) ) { | 322 | if( !copyFile( curFile, destFile) ) { |
329 | QMessageBox::message("AdvancedFm", | 323 | QMessageBox::message("AdvancedFm", |
330 | tr( "<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); | 324 | tr( "<P>Could not copy %1 to %2</P>").arg(curFile).arg(destFile)); |
331 | return; | 325 | return; |
332 | } | 326 | } |
333 | } | 327 | } |
334 | rePopulate(); | 328 | rePopulate(); |
335 | } | 329 | } |
336 | } | 330 | } |
337 | 331 | ||
338 | void AdvancedFm::copyAsTimer() { | 332 | void AdvancedFm::copyAsTimer() { |
339 | QTimer::singleShot(125,this,SLOT(copyAs())); | 333 | QTimer::singleShot(125,this,SLOT(copyAs())); |
340 | } | 334 | } |
341 | 335 | ||
342 | void AdvancedFm::copyAs() { | 336 | void AdvancedFm::copyAs() { |
343 | 337 | ||
344 | QStringList curFileList = getPath(); | 338 | QStringList curFileList = getPath(); |
345 | QString curFile, item; | 339 | QString curFile, item; |
346 | InputDialog *fileDlg; | 340 | InputDialog *fileDlg; |
347 | 341 | ||
348 | QDir *thisDir = CurrentDir(); | 342 | QDir *thisDir = CurrentDir(); |
349 | QDir *thatDir = OtherDir(); | 343 | QDir *thatDir = OtherDir(); |
350 | 344 | ||
351 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 345 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
352 | QString destFile; | 346 | QString destFile; |
353 | item=(*it); | 347 | item=(*it); |
354 | curFile = thisDir->canonicalPath()+"/"+(*it); | 348 | curFile = thisDir->canonicalPath()+"/"+(*it); |
355 | fileDlg = new InputDialog( this, tr("Copy %1 As").arg(curFile), TRUE, 0); | 349 | fileDlg = new InputDialog( this, tr("Copy %1 As").arg(curFile), TRUE, 0); |
356 | 350 | ||
357 | fileDlg->setInputText((const QString &) destFile ); | 351 | fileDlg->setInputText((const QString &) destFile ); |
358 | fileDlg->exec(); | 352 | fileDlg->exec(); |
359 | 353 | ||