-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 200 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 6 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 102 |
3 files changed, 87 insertions, 221 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 74654fc..fc6c3bf 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -74,8 +74,10 @@ AdvancedFm::AdvancedFm( ) | |||
74 | renameBox = 0; | 74 | renameBox = 0; |
75 | 75 | ||
76 | initConnections(); | 76 | initConnections(); |
77 | populateLocalView(); | 77 | TabWidget->setCurrentTab(1); |
78 | populateRemoteView(); | 78 | populateView(); |
79 | TabWidget->setCurrentTab(0); | ||
80 | populateView(); | ||
79 | currentPathCombo->setFocus(); | 81 | currentPathCombo->setFocus(); |
80 | } | 82 | } |
81 | 83 | ||
@@ -115,22 +117,27 @@ void AdvancedFm::tabChanged(QWidget *w) | |||
115 | setCaption("AdvancedFm :: "+fs+" :: " | 117 | setCaption("AdvancedFm :: "+fs+" :: " |
116 | +checkDiskSpace( (const QString &) path )+ " kB free" ); | 118 | +checkDiskSpace( (const QString &) path )+ " kB free" ); |
117 | chdir( path.latin1()); | 119 | chdir( path.latin1()); |
120 | //2populateView(); | ||
118 | } | 121 | } |
119 | 122 | ||
120 | 123 | ||
121 | void AdvancedFm::populateLocalView() | 124 | void AdvancedFm::populateView() |
122 | { | 125 | { |
123 | QPixmap pm; | 126 | QPixmap pm; |
124 | Local_View->clear(); | 127 | QListView *thisView = CurrentView(); |
125 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 128 | QDir *thisDir = CurrentDir(); |
126 | currentDir.setMatchAllDirs(TRUE); | 129 | QString path = thisDir->canonicalPath(); |
127 | currentDir.setNameFilter(filterStr); | 130 | |
131 | thisView->clear(); | ||
132 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | ||
133 | thisDir->setMatchAllDirs(TRUE); | ||
134 | thisDir->setNameFilter(filterStr); | ||
128 | QString fileL, fileS, fileDate; | 135 | QString fileL, fileS, fileDate; |
129 | QString fs= getFileSystemType((const QString &) currentDir.canonicalPath()); | 136 | QString fs= getFileSystemType((const QString &) path); |
130 | setCaption("AdvancedFm :: "+fs+" :: " | 137 | setCaption("AdvancedFm :: "+fs+" :: " |
131 | +checkDiskSpace((const QString &) currentDir.canonicalPath())+" kB free" ); | 138 | +checkDiskSpace((const QString &) path)+" kB free" ); |
132 | bool isDir=FALSE; | 139 | bool isDir=FALSE; |
133 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | 140 | const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); |
134 | QFileInfoListIterator it(*list); | 141 | QFileInfoListIterator it(*list); |
135 | QFileInfo *fi; | 142 | QFileInfo *fi; |
136 | while ( (fi=it.current()) ) | 143 | while ( (fi=it.current()) ) |
@@ -148,16 +155,18 @@ void AdvancedFm::populateLocalView() | |||
148 | fileS.sprintf( "%10i", fi->size() ); | 155 | fileS.sprintf( "%10i", fi->size() ); |
149 | fileL.sprintf( "%s",fi->fileName().data() ); | 156 | fileL.sprintf( "%s",fi->fileName().data() ); |
150 | fileDate= fi->lastModified().toString(); | 157 | fileDate= fi->lastModified().toString(); |
151 | if( QDir(QDir::cleanDirPath( currentDir.canonicalPath()+"/"+fileL)).exists() ) | 158 | if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) |
152 | { | 159 | { |
153 | fileL+="/"; | 160 | fileL+="/"; |
154 | isDir=TRUE; | 161 | isDir=TRUE; |
155 | } | 162 | } |
156 | } | 163 | } |
157 | QFileInfo fileInfo( currentDir.canonicalPath()+"/"+fileL); | 164 | |
165 | QFileInfo fileInfo( path + "/" + fileL); | ||
166 | |||
158 | if(fileL !="./" && fi->exists()) | 167 | if(fileL !="./" && fi->exists()) |
159 | { | 168 | { |
160 | item= new QListViewItem( Local_View, fileL, fileS , fileDate); | 169 | item= new QListViewItem( thisView, fileL, fileS , fileDate); |
161 | 170 | ||
162 | if(isDir || fileL.find("/",0,TRUE) != -1) | 171 | if(isDir || fileL.find("/",0,TRUE) != -1) |
163 | { | 172 | { |
@@ -203,14 +212,14 @@ void AdvancedFm::populateLocalView() | |||
203 | ++it; | 212 | ++it; |
204 | } | 213 | } |
205 | 214 | ||
206 | if(currentDir.canonicalPath().find("dev",0,TRUE) != -1) | 215 | if( path.find("dev",0,TRUE) != -1) |
207 | { | 216 | { |
208 | struct stat buf; | 217 | struct stat buf; |
209 | dev_t devT; | 218 | dev_t devT; |
210 | DIR *dir; | 219 | DIR *dir; |
211 | struct dirent *mydirent; | 220 | struct dirent *mydirent; |
212 | 221 | ||
213 | if((dir = opendir( currentDir.canonicalPath().latin1())) != NULL) | 222 | if((dir = opendir( path.latin1())) != NULL) |
214 | while ((mydirent = readdir(dir)) != NULL) | 223 | while ((mydirent = readdir(dir)) != NULL) |
215 | { | 224 | { |
216 | lstat( mydirent->d_name, &buf); | 225 | lstat( mydirent->d_name, &buf); |
@@ -221,7 +230,7 @@ void AdvancedFm::populateLocalView() | |||
221 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); | 230 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); |
222 | if( fileL.find(".") == -1 ) | 231 | if( fileL.find(".") == -1 ) |
223 | { | 232 | { |
224 | item= new QListViewItem( Local_View, fileL, fileS, fileDate); | 233 | item= new QListViewItem( thisView, fileL, fileS, fileDate); |
225 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 234 | pm = Resource::loadPixmap( "UnknownDocument-14" ); |
226 | item->setPixmap( 0,pm); | 235 | item->setPixmap( 0,pm); |
227 | } | 236 | } |
@@ -230,132 +239,11 @@ void AdvancedFm::populateLocalView() | |||
230 | closedir(dir); | 239 | closedir(dir); |
231 | } | 240 | } |
232 | 241 | ||
233 | Local_View->setSorting( 3,FALSE); | 242 | thisView->setSorting( 3,FALSE); |
234 | fillCombo( (const QString &) currentDir.canonicalPath()); | 243 | fillCombo( (const QString &) path ); |
235 | } | 244 | } |
236 | 245 | ||
237 | 246 | ||
238 | void AdvancedFm::populateRemoteView() | ||
239 | { | ||
240 | QPixmap pm; | ||
241 | Remote_View->clear(); | ||
242 | currentRemoteDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | ||
243 | currentRemoteDir.setMatchAllDirs(TRUE); | ||
244 | currentRemoteDir.setNameFilter(filterStr); | ||
245 | QString fileL, fileS, fileDate; | ||
246 | |||
247 | QString fs= getFileSystemType((const QString &) currentRemoteDir.canonicalPath()); | ||
248 | setCaption("AdvancedFm :: "+fs+" :: " | ||
249 | +checkDiskSpace((const QString &) currentRemoteDir.canonicalPath())+" kB free" ); | ||
250 | bool isDir=FALSE; | ||
251 | const QFileInfoList *list = currentRemoteDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | ||
252 | QFileInfoListIterator it(*list); | ||
253 | QFileInfo *fi; | ||
254 | while ( (fi=it.current()) ) | ||
255 | { | ||
256 | if (fi->isSymLink() ) | ||
257 | { | ||
258 | QString symLink=fi->readLink(); | ||
259 | // qDebug("Symlink detected "+symLink); | ||
260 | QFileInfo sym( symLink); | ||
261 | fileS.sprintf( "%10i", sym.size() ); | ||
262 | fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.filePath().data() ); | ||
263 | fileDate = sym.lastModified().toString(); | ||
264 | } | ||
265 | else | ||
266 | { | ||
267 | // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); | ||
268 | fileS.sprintf( "%10i", fi->size() ); | ||
269 | fileL.sprintf( "%s",fi->fileName().data() ); | ||
270 | fileDate= fi->lastModified().toString(); | ||
271 | |||
272 | if( QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+fileL)).exists() ) | ||
273 | { | ||
274 | fileL+="/"; | ||
275 | isDir=TRUE; | ||
276 | // qDebug( fileL); | ||
277 | } | ||
278 | } | ||
279 | |||
280 | QFileInfo fileInfo( currentRemoteDir.canonicalPath()+"/"+fileL); | ||
281 | if(fileL !="./" && fi->exists()) | ||
282 | { | ||
283 | item= new QListViewItem( Remote_View, fileL, fileS, fileDate); | ||
284 | QPixmap pm; | ||
285 | |||
286 | if(isDir || fileL.find("/",0,TRUE) != -1) | ||
287 | { | ||
288 | if( !QDir( fi->filePath() ).isReadable()) | ||
289 | pm = Resource::loadPixmap( "lockedfolder" ); | ||
290 | else | ||
291 | pm= Resource::loadPixmap( "folder" ); | ||
292 | } | ||
293 | else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) | ||
294 | { | ||
295 | pm = Resource::loadPixmap( "exec"); | ||
296 | } | ||
297 | else if( (fileInfo.permission( QFileInfo::ExeUser) | ||
298 | | fileInfo.permission( QFileInfo::ExeGroup) | ||
299 | | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) | ||
300 | { | ||
301 | pm = Resource::loadPixmap( "exec"); | ||
302 | } | ||
303 | else if( !fi->isReadable() ) | ||
304 | { | ||
305 | pm = Resource::loadPixmap( "locked" ); | ||
306 | } | ||
307 | else | ||
308 | { | ||
309 | MimeType mt(fi->filePath()); | ||
310 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | ||
311 | if(pm.isNull()) | ||
312 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | ||
313 | } | ||
314 | if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) | ||
315 | { | ||
316 | // overlay link image | ||
317 | pm= Resource::loadPixmap( "folder" ); | ||
318 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | ||
319 | QPainter painter( &pm ); | ||
320 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | ||
321 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | ||
322 | } | ||
323 | item->setPixmap( 0, pm); | ||
324 | } | ||
325 | isDir=FALSE; | ||
326 | ++it; | ||
327 | } | ||
328 | |||
329 | if(currentRemoteDir.canonicalPath().find("dev",0,TRUE) != -1) | ||
330 | { | ||
331 | struct stat buf; | ||
332 | DIR *dir; | ||
333 | struct dirent *mydirent; | ||
334 | if((dir = opendir( currentRemoteDir.canonicalPath().latin1())) != NULL) | ||
335 | |||
336 | while ((mydirent = readdir(dir)) != NULL) | ||
337 | { | ||
338 | lstat( mydirent->d_name, &buf); | ||
339 | // qDebug(mydirent->d_name); | ||
340 | fileL.sprintf("%s", mydirent->d_name); | ||
341 | fileS.sprintf("%d,%d", (int) (buf.st_dev>>8)&0xFF, (int) buf.st_dev &0xFF); | ||
342 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); | ||
343 | |||
344 | if( fileL.find(".") == -1 ) | ||
345 | { | ||
346 | item= new QListViewItem( Remote_View, fileL, fileS, fileDate); | ||
347 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | ||
348 | item->setPixmap( 0,pm); | ||
349 | } | ||
350 | } | ||
351 | |||
352 | closedir(dir); | ||
353 | } | ||
354 | |||
355 | Remote_View->setSorting( 3,FALSE); | ||
356 | fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); | ||
357 | } | ||
358 | |||
359 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) | 247 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) |
360 | { | 248 | { |
361 | if(selectedItem) | 249 | if(selectedItem) |
@@ -383,7 +271,7 @@ void AdvancedFm::ListClicked(QListViewItem *selectedItem) | |||
383 | if( isDirectory ) | 271 | if( isDirectory ) |
384 | { | 272 | { |
385 | CurrentDir()->cd( strItem, TRUE); | 273 | CurrentDir()->cd( strItem, TRUE); |
386 | PopulateView(); | 274 | populateView(); |
387 | CurrentView()->ensureItemVisible( CurrentView()->firstChild()); | 275 | CurrentView()->ensureItemVisible( CurrentView()->firstChild()); |
388 | } | 276 | } |
389 | chdir( strItem.latin1()); | 277 | chdir( strItem.latin1()); |
@@ -434,7 +322,7 @@ void AdvancedFm::currentPathComboChanged() | |||
434 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) | 322 | if(QDir( currentPathCombo->lineEdit()->text()).exists()) |
435 | { | 323 | { |
436 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); | 324 | CurrentDir()->setPath( currentPathCombo->lineEdit()->text() ); |
437 | PopulateView(); | 325 | populateView(); |
438 | } | 326 | } |
439 | else | 327 | else |
440 | { | 328 | { |
@@ -471,7 +359,7 @@ void AdvancedFm::currentPathComboActivated(const QString & currentPath) | |||
471 | { | 359 | { |
472 | chdir( currentPath.latin1() ); | 360 | chdir( currentPath.latin1() ); |
473 | CurrentDir()->cd( currentPath, TRUE); | 361 | CurrentDir()->cd( currentPath, TRUE); |
474 | PopulateView(); | 362 | populateView(); |
475 | update(); | 363 | update(); |
476 | } | 364 | } |
477 | 365 | ||
@@ -497,7 +385,7 @@ void AdvancedFm::homeButtonPushed() | |||
497 | QString current = QDir::homeDirPath(); | 385 | QString current = QDir::homeDirPath(); |
498 | chdir( current.latin1() ); | 386 | chdir( current.latin1() ); |
499 | CurrentDir()->cd( current, TRUE); | 387 | CurrentDir()->cd( current, TRUE); |
500 | PopulateView(); | 388 | populateView(); |
501 | update(); | 389 | update(); |
502 | } | 390 | } |
503 | 391 | ||
@@ -507,7 +395,7 @@ void AdvancedFm::docButtonPushed() | |||
507 | chdir( current.latin1() ); | 395 | chdir( current.latin1() ); |
508 | 396 | ||
509 | CurrentDir()->cd( current, TRUE); | 397 | CurrentDir()->cd( current, TRUE); |
510 | PopulateView(); | 398 | populateView(); |
511 | update(); | 399 | update(); |
512 | } | 400 | } |
513 | 401 | ||
@@ -516,7 +404,7 @@ void AdvancedFm::SDButtonPushed() | |||
516 | QString current = "/mnt/card";// this can change so fix | 404 | QString current = "/mnt/card";// this can change so fix |
517 | chdir( current.latin1() ); | 405 | chdir( current.latin1() ); |
518 | CurrentDir()->cd( current, TRUE); | 406 | CurrentDir()->cd( current, TRUE); |
519 | PopulateView(); | 407 | populateView(); |
520 | update(); | 408 | update(); |
521 | } | 409 | } |
522 | 410 | ||
@@ -530,7 +418,7 @@ void AdvancedFm::CFButtonPushed() | |||
530 | 418 | ||
531 | chdir( current.latin1() ); | 419 | chdir( current.latin1() ); |
532 | CurrentDir()->cd( current, TRUE); | 420 | CurrentDir()->cd( current, TRUE); |
533 | PopulateView(); | 421 | populateView(); |
534 | update(); | 422 | update(); |
535 | } | 423 | } |
536 | 424 | ||
@@ -631,7 +519,7 @@ void AdvancedFm::QPEButtonPushed() | |||
631 | QString current = QPEApplication::qpeDir(); | 519 | QString current = QPEApplication::qpeDir(); |
632 | chdir( current.latin1() ); | 520 | chdir( current.latin1() ); |
633 | CurrentDir()->cd( current, TRUE); | 521 | CurrentDir()->cd( current, TRUE); |
634 | PopulateView(); | 522 | populateView(); |
635 | update(); | 523 | update(); |
636 | } | 524 | } |
637 | 525 | ||
@@ -948,7 +836,7 @@ void AdvancedFm::gotoCustomDir(const QString &dir) | |||
948 | thisDir->setPath( curDir ); | 836 | thisDir->setPath( curDir ); |
949 | chdir( curDir.latin1() ); | 837 | chdir( curDir.latin1() ); |
950 | thisDir->cd( curDir, TRUE); | 838 | thisDir->cd( curDir, TRUE); |
951 | PopulateView(); | 839 | populateView(); |
952 | } | 840 | } |
953 | } | 841 | } |
954 | } | 842 | } |
@@ -977,14 +865,6 @@ QDir *AdvancedFm::OtherDir() | |||
977 | } | 865 | } |
978 | } | 866 | } |
979 | 867 | ||
980 | void AdvancedFm::PopulateView() | ||
981 | { | ||
982 | if ( whichTab == 1) | ||
983 | populateLocalView(); | ||
984 | else | ||
985 | populateRemoteView(); | ||
986 | } | ||
987 | |||
988 | QListView * AdvancedFm::CurrentView() | 868 | QListView * AdvancedFm::CurrentView() |
989 | { | 869 | { |
990 | if ( whichTab == 1) | 870 | if ( whichTab == 1) |
@@ -1000,3 +880,11 @@ QListView * AdvancedFm::OtherView() | |||
1000 | else | 880 | else |
1001 | return Local_View; | 881 | return Local_View; |
1002 | } | 882 | } |
883 | |||
884 | void AdvancedFm::setOtherTabCurrent() | ||
885 | { | ||
886 | if ( whichTab == 1) | ||
887 | TabWidget->setCurrentTab(1); | ||
888 | else | ||
889 | TabWidget->setCurrentTab(0); | ||
890 | } | ||
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 8eec6ba..024ab29 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -63,11 +63,9 @@ protected slots: | |||
63 | void mkDir(); | 63 | void mkDir(); |
64 | void del(); | 64 | void del(); |
65 | void rn(); | 65 | void rn(); |
66 | void populateLocalView(); | 66 | void populateView(); |
67 | void populateRemoteView(); | ||
68 | void showHidden(); | 67 | void showHidden(); |
69 | void showMenuHidden(); | 68 | void showMenuHidden(); |
70 | // void showRemoteHidden(); | ||
71 | void writeConfig(); | 69 | void writeConfig(); |
72 | void readConfig(); | 70 | void readConfig(); |
73 | void ListClicked(QListViewItem *); | 71 | void ListClicked(QListViewItem *); |
@@ -125,7 +123,7 @@ protected: | |||
125 | QDir *OtherDir(); | 123 | QDir *OtherDir(); |
126 | QListView *CurrentView(); | 124 | QListView *CurrentView(); |
127 | QListView *OtherView(); | 125 | QListView *OtherView(); |
128 | void PopulateView(); | 126 | void setOtherTabCurrent(); |
129 | 127 | ||
130 | protected slots: | 128 | protected slots: |
131 | void dirMenuSelected(int); | 129 | void dirMenuSelected(int); |
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 13dad33..c553017 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -68,8 +68,8 @@ void AdvancedFm::showMenuHidden() | |||
68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 68 | fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
69 | // b=TRUE; | 69 | // b=TRUE; |
70 | } | 70 | } |
71 | populateLocalView(); | 71 | populateView(); |
72 | populateRemoteView(); | 72 | // populateRemoteView(); |
73 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); | 73 | // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); |
74 | if(b) b = false; else b = true; | 74 | if(b) b = false; else b = true; |
75 | } | 75 | } |
@@ -89,7 +89,7 @@ void AdvancedFm::showHidden() | |||
89 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); | 89 | // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); |
90 | // b=TRUE; | 90 | // b=TRUE; |
91 | } | 91 | } |
92 | PopulateView(); | 92 | populateView(); |
93 | } | 93 | } |
94 | 94 | ||
95 | QString AdvancedFm::dealWithSymName(const QString &fileName) | 95 | QString AdvancedFm::dealWithSymName(const QString &fileName) |
@@ -165,7 +165,7 @@ void AdvancedFm::makeDir() | |||
165 | QString filename = fileDlg->LineEdit1->text(); | 165 | QString filename = fileDlg->LineEdit1->text(); |
166 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); | 166 | thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); |
167 | } | 167 | } |
168 | PopulateView(); | 168 | populateView(); |
169 | } | 169 | } |
170 | 170 | ||
171 | void AdvancedFm::doDelete() | 171 | void AdvancedFm::doDelete() |
@@ -214,7 +214,7 @@ void AdvancedFm::doDelete() | |||
214 | f=f.left(f.length()-1); | 214 | f=f.left(f.length()-1); |
215 | QString cmd="rm -rf "+f; | 215 | QString cmd="rm -rf "+f; |
216 | startProcess( (const QString)cmd.latin1() ); | 216 | startProcess( (const QString)cmd.latin1() ); |
217 | PopulateView(); | 217 | populateView(); |
218 | } | 218 | } |
219 | break; | 219 | break; |
220 | case 1: | 220 | case 1: |
@@ -238,7 +238,7 @@ void AdvancedFm::doDelete() | |||
238 | } | 238 | } |
239 | } | 239 | } |
240 | } | 240 | } |
241 | PopulateView(); | 241 | populateView(); |
242 | } | 242 | } |
243 | 243 | ||
244 | void AdvancedFm::filePerms() | 244 | void AdvancedFm::filePerms() |
@@ -257,7 +257,7 @@ void AdvancedFm::filePerms() | |||
257 | if( filePerm) | 257 | if( filePerm) |
258 | delete filePerm; | 258 | delete filePerm; |
259 | } | 259 | } |
260 | PopulateView(); | 260 | populateView(); |
261 | } | 261 | } |
262 | 262 | ||
263 | void AdvancedFm::doProperties() | 263 | void AdvancedFm::doProperties() |
@@ -293,7 +293,7 @@ void AdvancedFm::upDir() | |||
293 | chdir( current.latin1() ); | 293 | chdir( current.latin1() ); |
294 | thisDir->cd( current, TRUE); | 294 | thisDir->cd( current, TRUE); |
295 | 295 | ||
296 | PopulateView(); | 296 | populateView(); |
297 | update(); | 297 | update(); |
298 | } | 298 | } |
299 | 299 | ||
@@ -360,9 +360,8 @@ void AdvancedFm::copy() | |||
360 | return; | 360 | return; |
361 | } | 361 | } |
362 | } | 362 | } |
363 | 363 | setOtherTabCurrent(); | |
364 | PopulateView(); | 364 | populateView(); |
365 | // TabWidget->setCurrentTab(1); | ||
366 | } | 365 | } |
367 | } | 366 | } |
368 | 367 | ||
@@ -417,7 +416,8 @@ void AdvancedFm::copyAs() | |||
417 | delete fileDlg; | 416 | delete fileDlg; |
418 | 417 | ||
419 | } | 418 | } |
420 | PopulateView(); | 419 | setOtherTabCurrent(); |
420 | populateView(); | ||
421 | } | 421 | } |
422 | 422 | ||
423 | void AdvancedFm::copySameDir() | 423 | void AdvancedFm::copySameDir() |
@@ -470,7 +470,7 @@ void AdvancedFm::copySameDir() | |||
470 | } | 470 | } |
471 | delete fileDlg; | 471 | delete fileDlg; |
472 | } | 472 | } |
473 | PopulateView(); | 473 | populateView(); |
474 | } | 474 | } |
475 | 475 | ||
476 | void AdvancedFm::move() | 476 | void AdvancedFm::move() |
@@ -512,8 +512,9 @@ void AdvancedFm::move() | |||
512 | } | 512 | } |
513 | 513 | ||
514 | } | 514 | } |
515 | populateRemoteView(); | 515 | setOtherTabCurrent(); |
516 | populateLocalView(); | 516 | populateView(); |
517 | // populateLocalView(); | ||
517 | } | 518 | } |
518 | 519 | ||
519 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) | 520 | bool AdvancedFm::copyFile( const QString & src, const QString & dest ) |
@@ -643,52 +644,32 @@ void AdvancedFm::mkSym() | |||
643 | QStringList curFileList = getPath(); | 644 | QStringList curFileList = getPath(); |
644 | if( curFileList.count() > 0) | 645 | if( curFileList.count() > 0) |
645 | { | 646 | { |
646 | if ( whichTab == 1) | 647 | QDir *thisDir = CurrentDir(); |
647 | { | 648 | QDir * thatDir = OtherDir(); |
648 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | ||
649 | { | ||
650 | 649 | ||
651 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); | 650 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) |
652 | if(destName.right(1) == "/") | ||
653 | { | ||
654 | destName = destName.left( destName.length() -1); | ||
655 | } | ||
656 | QString curFile = currentDir.canonicalPath()+"/"+(*it); | ||
657 | if( curFile.right(1) == "/") | ||
658 | { | ||
659 | curFile = curFile.left( curFile.length() -1); | ||
660 | } | ||
661 | cmd = "ln -s "+curFile+" "+destName; | ||
662 | qDebug(cmd); | ||
663 | startProcess( (const QString)cmd ); | ||
664 | } | ||
665 | populateRemoteView(); | ||
666 | TabWidget->setCurrentTab(1); | ||
667 | } | ||
668 | else | ||
669 | { | 651 | { |
670 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) | 652 | |
653 | QString destName = thatDir->canonicalPath()+"/"+(*it); | ||
654 | if(destName.right(1) == "/") | ||
671 | { | 655 | { |
656 | destName = destName.left( destName.length() -1); | ||
657 | } | ||
672 | 658 | ||
673 | QString destName = currentDir.canonicalPath()+"/"+(*it); | 659 | QString curFile = thisDir->canonicalPath()+"/"+(*it); |
674 | if(destName.right(1) == "/") | ||
675 | { | ||
676 | destName = destName.left( destName.length() -1); | ||
677 | } | ||
678 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | ||
679 | if( curFile.right(1) == "/") | ||
680 | { | ||
681 | curFile = curFile.left( curFile.length() -1); | ||
682 | } | ||
683 | 660 | ||
684 | cmd = "ln -s "+curFile+" "+destName; | 661 | if( curFile.right(1) == "/") |
685 | qDebug(cmd); | 662 | { |
686 | startProcess( (const QString)cmd ); | 663 | curFile = curFile.left( curFile.length() -1); |
687 | } | 664 | } |
688 | populateLocalView(); | 665 | |
689 | TabWidget->setCurrentTab(0); | 666 | cmd = "ln -s "+curFile+" "+destName; |
690 | } | 667 | qDebug(cmd); |
691 | } | 668 | startProcess( (const QString)cmd ); |
669 | } | ||
670 | setOtherTabCurrent(); | ||
671 | populateView(); | ||
672 | } | ||
692 | } | 673 | } |
693 | 674 | ||
694 | void AdvancedFm::doBeam() | 675 | void AdvancedFm::doBeam() |
@@ -699,7 +680,6 @@ void AdvancedFm::doBeam() | |||
699 | } | 680 | } |
700 | else | 681 | else |
701 | { | 682 | { |
702 | |||
703 | QStringList curFileList = getPath(); | 683 | QStringList curFileList = getPath(); |
704 | if( curFileList.count() > 0) | 684 | if( curFileList.count() > 0) |
705 | { | 685 | { |
@@ -755,8 +735,8 @@ void AdvancedFm::startProcess(const QString & cmd) | |||
755 | 735 | ||
756 | void AdvancedFm::processEnded() | 736 | void AdvancedFm::processEnded() |
757 | { | 737 | { |
758 | populateLocalView(); | 738 | // populateLocalView(); |
759 | populateRemoteView(); | 739 | populateView(); |
760 | } | 740 | } |
761 | 741 | ||
762 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) | 742 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) |
@@ -843,7 +823,7 @@ void AdvancedFm::renameIt() | |||
843 | QListView *thisView = CurrentView(); | 823 | QListView *thisView = CurrentView(); |
844 | oldName = thisView->currentItem()->text(0); | 824 | oldName = thisView->currentItem()->text(0); |
845 | doRename( thisView ); | 825 | doRename( thisView ); |
846 | PopulateView(); | 826 | populateView(); |
847 | } | 827 | } |
848 | 828 | ||
849 | void AdvancedFm::okRename() | 829 | void AdvancedFm::okRename() |
@@ -865,5 +845,5 @@ void AdvancedFm::okRename() | |||
865 | 845 | ||
866 | view->takeItem( view->currentItem() ); | 846 | view->takeItem( view->currentItem() ); |
867 | delete view->currentItem(); | 847 | delete view->currentItem(); |
868 | PopulateView(); | 848 | populateView(); |
869 | } | 849 | } |