-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 4289fcf..5f47b9b 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -115,194 +115,194 @@ AdvancedFm::AdvancedFm( ) | |||
115 | layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); | 115 | layout->addMultiCellWidget( homeButton, 0, 0, 6, 6); |
116 | // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); | 116 | // fileMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); |
117 | // fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); | 117 | // fileMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); |
118 | // fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); | 118 | // fileMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); |
119 | 119 | ||
120 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 120 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
121 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 121 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
122 | fileMenu->insertSeparator(); | 122 | fileMenu->insertSeparator(); |
123 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 123 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
124 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 124 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
125 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 125 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
126 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 126 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
127 | fileMenu->insertSeparator(); | 127 | fileMenu->insertSeparator(); |
128 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); | 128 | fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); |
129 | fileMenu->setCheckable(TRUE); | 129 | fileMenu->setCheckable(TRUE); |
130 | 130 | ||
131 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); | 131 | viewMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); |
132 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); | 132 | viewMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); |
133 | viewMenu->insertSeparator(); | 133 | viewMenu->insertSeparator(); |
134 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); | 134 | viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); |
135 | viewMenu->setCheckable(TRUE); | 135 | viewMenu->setCheckable(TRUE); |
136 | 136 | ||
137 | TabWidget = new QTabWidget( this, "TabWidget" ); | 137 | TabWidget = new QTabWidget( this, "TabWidget" ); |
138 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); | 138 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 6); |
139 | 139 | ||
140 | tab = new QWidget( TabWidget, "tab" ); | 140 | tab = new QWidget( TabWidget, "tab" ); |
141 | tabLayout = new QGridLayout( tab ); | 141 | tabLayout = new QGridLayout( tab ); |
142 | tabLayout->setSpacing( 2); | 142 | tabLayout->setSpacing( 2); |
143 | tabLayout->setMargin( 2); | 143 | tabLayout->setMargin( 2); |
144 | 144 | ||
145 | Local_View = new QListView( tab, "Local_View" ); | 145 | Local_View = new QListView( tab, "Local_View" ); |
146 | // Local_View->setResizePolicy( QListView::AutoOneFit ); | 146 | // Local_View->setResizePolicy( QListView::AutoOneFit ); |
147 | Local_View->addColumn( tr("File"),130); | 147 | Local_View->addColumn( tr("File"),130); |
148 | Local_View->addColumn( tr("Size"),-1); | 148 | Local_View->addColumn( tr("Size"),-1); |
149 | Local_View->setColumnAlignment(1,QListView::AlignRight); | 149 | Local_View->setColumnAlignment(1,QListView::AlignRight); |
150 | Local_View->addColumn( tr("Date"),-1); | 150 | Local_View->addColumn( tr("Date"),-1); |
151 | Local_View->setColumnAlignment(2,QListView::AlignRight); | 151 | Local_View->setColumnAlignment(2,QListView::AlignRight); |
152 | Local_View->setAllColumnsShowFocus(TRUE); | 152 | Local_View->setAllColumnsShowFocus(TRUE); |
153 | // Local_View->setMultiSelection( TRUE ); | 153 | // Local_View->setMultiSelection( TRUE ); |
154 | // Local_View->setSelectionMode(QListView::Extended); | 154 | // Local_View->setSelectionMode(QListView::Extended); |
155 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 155 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
156 | 156 | ||
157 | tabLayout->addWidget( Local_View, 0, 0 ); | 157 | tabLayout->addWidget( Local_View, 0, 0 ); |
158 | 158 | ||
159 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | 159 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), |
160 | this,SLOT( localListClicked(QListViewItem *)) ); | 160 | this,SLOT( localListClicked(QListViewItem *)) ); |
161 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 161 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
162 | this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); | 162 | this,SLOT( localListPressed(int, QListViewItem *, const QPoint&, int)) ); |
163 | 163 | ||
164 | TabWidget->insertTab( tab, tr("1")); | 164 | TabWidget->insertTab( tab, tr("1")); |
165 | 165 | ||
166 | tab_2 = new QWidget( TabWidget, "tab_2" ); | 166 | tab_2 = new QWidget( TabWidget, "tab_2" ); |
167 | tabLayout_2 = new QGridLayout( tab_2 ); | 167 | tabLayout_2 = new QGridLayout( tab_2 ); |
168 | tabLayout_2->setSpacing( 2); | 168 | tabLayout_2->setSpacing( 2); |
169 | tabLayout_2->setMargin( 2); | 169 | tabLayout_2->setMargin( 2); |
170 | 170 | ||
171 | Remote_View = new QListView( tab_2, "Remote_View" ); | 171 | Remote_View = new QListView( tab_2, "Remote_View" ); |
172 | Remote_View->addColumn( tr("File"),130); | 172 | Remote_View->addColumn( tr("File"),130); |
173 | Remote_View->addColumn( tr("Size"),-1); | 173 | Remote_View->addColumn( tr("Size"),-1); |
174 | Remote_View->setColumnAlignment(1,QListView::AlignRight); | 174 | Remote_View->setColumnAlignment(1,QListView::AlignRight); |
175 | Remote_View->addColumn( tr("Date"),-1); | 175 | Remote_View->addColumn( tr("Date"),-1); |
176 | Remote_View->setColumnAlignment(2,QListView::AlignRight); | 176 | Remote_View->setColumnAlignment(2,QListView::AlignRight); |
177 | Remote_View->setAllColumnsShowFocus(TRUE); | 177 | Remote_View->setAllColumnsShowFocus(TRUE); |
178 | // Remote_View->setMultiSelection( TRUE ); | 178 | // Remote_View->setMultiSelection( TRUE ); |
179 | // Remote_View->setSelectionMode(QListView::Extended); | 179 | // Remote_View->setSelectionMode(QListView::Extended); |
180 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); | 180 | QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); |
181 | 181 | ||
182 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), | 182 | connect( Remote_View, SIGNAL( clicked( QListViewItem*)), |
183 | this,SLOT( remoteListClicked(QListViewItem *)) ); | 183 | this,SLOT( remoteListClicked(QListViewItem *)) ); |
184 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 184 | connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
185 | this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); | 185 | this,SLOT( remoteListPressed(int, QListViewItem *, const QPoint&, int)) ); |
186 | 186 | ||
187 | tabLayout_2->addWidget( Remote_View, 0, 0 ); | 187 | tabLayout_2->addWidget( Remote_View, 0, 0 ); |
188 | 188 | ||
189 | TabWidget->insertTab( tab_2, tr( "2")); | 189 | TabWidget->insertTab( tab_2, tr( "2")); |
190 | 190 | ||
191 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), | 191 | connect(TabWidget,SIGNAL(currentChanged(QWidget *)), |
192 | this,SLOT(tabChanged(QWidget*))); | 192 | this,SLOT(tabChanged(QWidget*))); |
193 | 193 | ||
194 | // tab_3 = new QWidget( TabWidget, "tab_3" ); | 194 | // tab_3 = new QWidget( TabWidget, "tab_3" ); |
195 | // tabLayout_3 = new QGridLayout( tab_3 ); | 195 | // tabLayout_3 = new QGridLayout( tab_3 ); |
196 | // tabLayout_3->setSpacing( 2); | 196 | // tabLayout_3->setSpacing( 2); |
197 | // tabLayout_3->setMargin( 2); | 197 | // tabLayout_3->setMargin( 2); |
198 | 198 | ||
199 | // OFileSelector *fileSelector; | 199 | // OFileSelector *fileSelector; |
200 | // fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); | 200 | // fileSelector = new OFileSelector(tab_3,0,0,"/","","*"); |
201 | // tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); | 201 | // tabLayout_3->addMultiCellWidget( fileSelector, 0, 0, 0, 3 ); |
202 | 202 | ||
203 | // TabWidget->insertTab( tab_3, tr( "Files" ) ); | 203 | // TabWidget->insertTab( tab_3, tr( "Files" ) ); |
204 | 204 | ||
205 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 205 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
206 | currentDir.setPath( QDir::currentDirPath()); | 206 | currentDir.setPath( QDir::currentDirPath()); |
207 | 207 | ||
208 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 208 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
209 | currentRemoteDir.setPath( QDir::currentDirPath()); | 209 | currentRemoteDir.setPath( QDir::currentDirPath()); |
210 | 210 | ||
211 | b = TRUE; | 211 | b = TRUE; |
212 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); | 212 | currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); |
213 | currentPathCombo->setEditable(TRUE); | 213 | currentPathCombo->setEditable(TRUE); |
214 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); | 214 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); |
215 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 215 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
216 | 216 | ||
217 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), | 217 | connect( currentPathCombo, SIGNAL( activated( const QString & ) ), |
218 | this, SLOT( currentPathComboActivated( const QString & ) ) ); | 218 | this, SLOT( currentPathComboActivated( const QString & ) ) ); |
219 | 219 | ||
220 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), | 220 | connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), |
221 | this,SLOT(currentPathComboChanged())); | 221 | this,SLOT(currentPathComboChanged())); |
222 | 222 | ||
223 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 223 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
224 | 224 | ||
225 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); | 225 | layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 6); |
226 | 226 | ||
227 | filterStr="*"; | 227 | filterStr="*"; |
228 | b=FALSE; | 228 | b=FALSE; |
229 | populateLocalView(); | 229 | populateLocalView(); |
230 | populateRemoteView(); | 230 | populateRemoteView(); |
231 | } | 231 | } |
232 | 232 | ||
233 | AdvancedFm::~AdvancedFm() | 233 | AdvancedFm::~AdvancedFm() |
234 | { | 234 | { |
235 | } | 235 | } |
236 | 236 | ||
237 | void AdvancedFm::cleanUp() | 237 | void AdvancedFm::cleanUp() |
238 | { | 238 | { |
239 | QString sfile=QDir::homeDirPath(); | 239 | QString sfile=QDir::homeDirPath(); |
240 | if(sfile.right(1) != "/") | 240 | if(sfile.right(1) != "/") |
241 | sfile+="/._temp"; | 241 | sfile+="/._temp"; |
242 | else | 242 | else |
243 | sfile+="._temp"; | 243 | sfile+="._temp"; |
244 | QFile file( sfile); | 244 | QFile file( sfile); |
245 | if(file.exists()) | 245 | if(file.exists()) |
246 | file.remove(); | 246 | file.remove(); |
247 | } | 247 | } |
248 | 248 | ||
249 | void AdvancedFm::tabChanged(QWidget *w) | 249 | void AdvancedFm::tabChanged(QWidget *w) |
250 | { | 250 | { |
251 | if (TabWidget->currentPageIndex() == 0) { | 251 | if (TabWidget->currentPageIndex() == 0) { |
252 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); | 252 | currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); |
253 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); | 253 | viewMenu->setItemChecked(viewMenu->idAt(0),TRUE); |
254 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); | 254 | viewMenu->setItemChecked(viewMenu->idAt(1),FALSE); |
255 | } | 255 | } |
256 | if (TabWidget->currentPageIndex() == 1) { | 256 | if (TabWidget->currentPageIndex() == 1) { |
257 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); | 257 | currentPathCombo->lineEdit()->setText( currentRemoteDir.canonicalPath()); |
258 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); | 258 | viewMenu->setItemChecked(viewMenu->idAt(1),TRUE); |
259 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); | 259 | viewMenu->setItemChecked(viewMenu->idAt(0),FALSE); |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | 263 | ||
264 | void AdvancedFm::populateLocalView() | 264 | void AdvancedFm::populateLocalView() |
265 | { | 265 | { |
266 | // QList<QListViewItem> * getSelectedItems( QListView * Local_View ); | 266 | // QList<QListViewItem> * getSelectedItems( QListView * Local_View ); |
267 | // QListViewItemIterator it( Local_View ); | 267 | // QListViewItemIterator it( Local_View ); |
268 | // for ( ; it.current(); ++it ) { | 268 | // for ( ; it.current(); ++it ) { |
269 | // if ( it.current()->isSelected() ) { | 269 | // if ( it.current()->isSelected() ) { |
270 | // QString strItem = it.current()->text(0); | 270 | // QString strItem = it.current()->text(0); |
271 | // QString localFile = currentDir.canonicalPath()+"/"+strItem; | 271 | // QString localFile = currentDir.canonicalPath()+"/"+strItem; |
272 | // QFileInfo fi(localFile); | 272 | // QFileInfo fi(localFile); |
273 | // } | 273 | // } |
274 | // } | 274 | // } |
275 | QPixmap pm; | 275 | QPixmap pm; |
276 | Local_View->clear(); | 276 | Local_View->clear(); |
277 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 277 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
278 | currentDir.setMatchAllDirs(TRUE); | 278 | currentDir.setMatchAllDirs(TRUE); |
279 | currentDir.setNameFilter(filterStr); | 279 | currentDir.setNameFilter(filterStr); |
280 | QString fileL, fileS, fileDate; | 280 | QString fileL, fileS, fileDate; |
281 | // qDebug(currentDir.canonicalPath()); | 281 | // qDebug(currentDir.canonicalPath()); |
282 | 282 | ||
283 | bool isDir=FALSE; | 283 | bool isDir=FALSE; |
284 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); | 284 | const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); |
285 | QFileInfoListIterator it(*list); | 285 | QFileInfoListIterator it(*list); |
286 | QFileInfo *fi; | 286 | QFileInfo *fi; |
287 | while ( (fi=it.current()) ) { | 287 | while ( (fi=it.current()) ) { |
288 | if (fi->isSymLink() ) { | 288 | if (fi->isSymLink() ) { |
289 | QString symLink=fi->readLink(); | 289 | QString symLink=fi->readLink(); |
290 | // qDebug("Symlink detected "+symLink); | 290 | // qDebug("Symlink detected "+symLink); |
291 | QFileInfo sym( symLink); | 291 | QFileInfo sym( symLink); |
292 | fileS.sprintf( "%10li", sym.size() ); | 292 | fileS.sprintf( "%10li", sym.size() ); |
293 | fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); | 293 | fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() ); |
294 | fileDate = sym.lastModified().toString(); | 294 | fileDate = sym.lastModified().toString(); |
295 | } else { | 295 | } else { |
296 | fileS.sprintf( "%10li", fi->size() ); | 296 | fileS.sprintf( "%10li", fi->size() ); |
297 | fileL.sprintf( "%s",fi->fileName().data() ); | 297 | fileL.sprintf( "%s",fi->fileName().data() ); |
298 | fileDate= fi->lastModified().toString(); | 298 | fileDate= fi->lastModified().toString(); |
299 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { | 299 | if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { |
300 | fileL+="/"; | 300 | fileL+="/"; |
301 | isDir=TRUE; | 301 | isDir=TRUE; |
302 | // qDebug( fileL); | 302 | // qDebug( fileL); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | if(fileL !="./" && fi->exists()) { | 305 | if(fileL !="./" && fi->exists()) { |
306 | item= new QListViewItem( Local_View, fileL, fileS , fileDate); | 306 | item= new QListViewItem( Local_View, fileL, fileS , fileDate); |
307 | 307 | ||
308 | if(isDir || fileL.find("/",0,TRUE) != -1) { | 308 | if(isDir || fileL.find("/",0,TRUE) != -1) { |
@@ -469,307 +469,307 @@ void AdvancedFm::populateRemoteView() | |||
469 | 469 | ||
470 | closedir(dir); | 470 | closedir(dir); |
471 | } | 471 | } |
472 | 472 | ||
473 | Remote_View->setSorting( 3,FALSE); | 473 | Remote_View->setSorting( 3,FALSE); |
474 | fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); | 474 | fillCombo( (const QString &) currentRemoteDir.canonicalPath() ); |
475 | } | 475 | } |
476 | 476 | ||
477 | void AdvancedFm::localListClicked(QListViewItem *selectedItem) | 477 | void AdvancedFm::localListClicked(QListViewItem *selectedItem) |
478 | { | 478 | { |
479 | if(selectedItem) { | 479 | if(selectedItem) { |
480 | QString strItem=selectedItem->text(0); | 480 | QString strItem=selectedItem->text(0); |
481 | QString strSize=selectedItem->text(1); | 481 | QString strSize=selectedItem->text(1); |
482 | strSize=strSize.stripWhiteSpace(); | 482 | strSize=strSize.stripWhiteSpace(); |
483 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink | 483 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink |
484 | // is symlink | 484 | // is symlink |
485 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 485 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
486 | if(QDir(strItem2).exists() ) { | 486 | if(QDir(strItem2).exists() ) { |
487 | currentDir.cd(strItem2, TRUE); | 487 | currentDir.cd(strItem2, TRUE); |
488 | populateLocalView(); | 488 | populateLocalView(); |
489 | } | 489 | } |
490 | } else { // not a symlink | 490 | } else { // not a symlink |
491 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { | 491 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
492 | if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { | 492 | if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { |
493 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); | 493 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); |
494 | currentDir.cd(strItem,FALSE); | 494 | currentDir.cd(strItem,FALSE); |
495 | populateLocalView(); | 495 | populateLocalView(); |
496 | } else { | 496 | } else { |
497 | currentDir.cdUp(); | 497 | currentDir.cdUp(); |
498 | populateLocalView(); | 498 | populateLocalView(); |
499 | } | 499 | } |
500 | if(QDir(strItem).exists()){ | 500 | if(QDir(strItem).exists()){ |
501 | currentDir.cd(strItem, TRUE); | 501 | currentDir.cd(strItem, TRUE); |
502 | populateLocalView(); | 502 | populateLocalView(); |
503 | } | 503 | } |
504 | } else { | 504 | } else { |
505 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); | 505 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); |
506 | if( QFile::exists(strItem ) ) { | 506 | if( QFile::exists(strItem ) ) { |
507 | // qDebug("upload "+strItem); | 507 | // qDebug("upload "+strItem); |
508 | } | 508 | } |
509 | } //end not symlink | 509 | } //end not symlink |
510 | chdir(strItem.latin1()); | 510 | chdir(strItem.latin1()); |
511 | } | 511 | } |
512 | } | 512 | } |
513 | } | 513 | } |
514 | 514 | ||
515 | void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) | 515 | void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) |
516 | { | 516 | { |
517 | if(selectedItem) { | 517 | if(selectedItem) { |
518 | QString strItem=selectedItem->text(0); | 518 | QString strItem=selectedItem->text(0); |
519 | QString strSize=selectedItem->text(1); | 519 | QString strSize=selectedItem->text(1); |
520 | strSize=strSize.stripWhiteSpace(); | 520 | strSize=strSize.stripWhiteSpace(); |
521 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink | 521 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink |
522 | // is symlink | 522 | // is symlink |
523 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); | 523 | QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); |
524 | if(QDir(strItem2).exists() ) { | 524 | if(QDir(strItem2).exists() ) { |
525 | currentRemoteDir.cd(strItem2, TRUE); | 525 | currentRemoteDir.cd(strItem2, TRUE); |
526 | populateRemoteView(); | 526 | populateRemoteView(); |
527 | } | 527 | } |
528 | } else { // not a symlink | 528 | } else { // not a symlink |
529 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { | 529 | if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { |
530 | if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) { | 530 | if(QDir(QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem)).exists() ) { |
531 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); | 531 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); |
532 | currentRemoteDir.cd(strItem,FALSE); | 532 | currentRemoteDir.cd(strItem,FALSE); |
533 | populateRemoteView(); | 533 | populateRemoteView(); |
534 | } else { | 534 | } else { |
535 | currentRemoteDir.cdUp(); | 535 | currentRemoteDir.cdUp(); |
536 | populateRemoteView(); | 536 | populateRemoteView(); |
537 | } | 537 | } |
538 | if(QDir(strItem).exists()){ | 538 | if(QDir(strItem).exists()){ |
539 | currentRemoteDir.cd(strItem, TRUE); | 539 | currentRemoteDir.cd(strItem, TRUE); |
540 | populateRemoteView(); | 540 | populateRemoteView(); |
541 | } | 541 | } |
542 | } else { | 542 | } else { |
543 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); | 543 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); |
544 | if( QFile::exists(strItem ) ) { | 544 | if( QFile::exists(strItem ) ) { |
545 | // qDebug("upload "+strItem); | 545 | // qDebug("upload "+strItem); |
546 | } | 546 | } |
547 | } //end not symlink | 547 | } //end not symlink |
548 | chdir(strItem.latin1()); | 548 | chdir(strItem.latin1()); |
549 | } | 549 | } |
550 | } | 550 | } |
551 | } | 551 | } |
552 | 552 | ||
553 | void AdvancedFm::doLocalCd() | 553 | void AdvancedFm::doLocalCd() |
554 | { | 554 | { |
555 | localListClicked( Local_View->currentItem()); | 555 | localListClicked( Local_View->currentItem()); |
556 | } | 556 | } |
557 | 557 | ||
558 | void AdvancedFm::doRemoteCd() | 558 | void AdvancedFm::doRemoteCd() |
559 | { | 559 | { |
560 | localListClicked( Remote_View->currentItem()); | 560 | localListClicked( Remote_View->currentItem()); |
561 | } | 561 | } |
562 | 562 | ||
563 | void AdvancedFm::showHidden() | 563 | void AdvancedFm::showHidden() |
564 | { | 564 | { |
565 | if (!b) { | 565 | if (b) { |
566 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 566 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
567 | // localMenu->setItemChecked(localMenu->idAt(0),TRUE); | 567 | // localMenu->setItemChecked(localMenu->idAt(0),TRUE); |
568 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 568 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
569 | b=TRUE; | 569 | b=TRUE; |
570 | 570 | ||
571 | } else { | 571 | } else { |
572 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 572 | currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
573 | // localMenu->setItemChecked(localMenu->idAt(0),FALSE); | 573 | // localMenu->setItemChecked(localMenu->idAt(0),FALSE); |
574 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 574 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
575 | b=FALSE; | 575 | b=FALSE; |
576 | } | 576 | } |
577 | populateLocalView(); | 577 | populateLocalView(); |
578 | } | 578 | } |
579 | 579 | ||
580 | void AdvancedFm::showRemoteHidden() | 580 | void AdvancedFm::showRemoteHidden() |
581 | { | 581 | { |
582 | if (!b) { | 582 | if (b) { |
583 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 583 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
584 | // viewMenu->setItemChecked(localMenu->idAt(0),TRUE); | 584 | // viewMenu->setItemChecked(localMenu->idAt(0),TRUE); |
585 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 585 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
586 | b=TRUE; | 586 | b=TRUE; |
587 | 587 | ||
588 | } else { | 588 | } else { |
589 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); | 589 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); |
590 | // localMenu->setItemChecked(localMenu->idAt(0),FALSE); | 590 | // localMenu->setItemChecked(localMenu->idAt(0),FALSE); |
591 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 591 | // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
592 | b=FALSE; | 592 | b=FALSE; |
593 | } | 593 | } |
594 | populateRemoteView(); | 594 | populateRemoteView(); |
595 | } | 595 | } |
596 | 596 | ||
597 | void AdvancedFm::localListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) | 597 | void AdvancedFm::localListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) |
598 | { | 598 | { |
599 | switch (mouse) { | 599 | switch (mouse) { |
600 | case 1: | 600 | case 1: |
601 | break; | 601 | break; |
602 | case 2: | 602 | case 2: |
603 | showLocalMenu(item); | 603 | showLocalMenu(item); |
604 | Local_View->clearSelection(); | 604 | Local_View->clearSelection(); |
605 | break; | 605 | break; |
606 | }; | 606 | }; |
607 | } | 607 | } |
608 | 608 | ||
609 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) | 609 | void AdvancedFm::remoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) |
610 | { | 610 | { |
611 | switch (mouse) { | 611 | switch (mouse) { |
612 | case 1: | 612 | case 1: |
613 | break; | 613 | break; |
614 | case 2: | 614 | case 2: |
615 | showRemoteMenu(item); | 615 | showRemoteMenu(item); |
616 | Remote_View->clearSelection(); | 616 | Remote_View->clearSelection(); |
617 | break; | 617 | break; |
618 | }; | 618 | }; |
619 | } | 619 | } |
620 | 620 | ||
621 | void AdvancedFm::showLocalMenu(QListViewItem * item) | 621 | void AdvancedFm::showLocalMenu(QListViewItem * item) |
622 | { | 622 | { |
623 | if(item) { | 623 | if(item) { |
624 | QPopupMenu m; | 624 | QPopupMenu m; |
625 | m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); | 625 | m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); |
626 | m.insertSeparator(); | 626 | m.insertSeparator(); |
627 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) | 627 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) |
628 | m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); | 628 | m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); |
629 | else | 629 | else |
630 | m.insertItem( tr( "Open" ), this, SLOT( runThis() )); | 630 | m.insertItem( tr( "Open" ), this, SLOT( runThis() )); |
631 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); | 631 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); |
632 | m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 632 | m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
633 | m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); | 633 | m.insertItem( tr( "Rename" ), this, SLOT( localRename() )); |
634 | m.insertItem( tr( "Copy" ), this, SLOT( copy() )); | 634 | m.insertItem( tr( "Copy" ), this, SLOT( copy() )); |
635 | m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); | 635 | m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); |
636 | m.insertItem( tr( "Move" ), this, SLOT( move() )); | 636 | m.insertItem( tr( "Move" ), this, SLOT( move() )); |
637 | m.insertSeparator(); | 637 | m.insertSeparator(); |
638 | m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); | 638 | m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); |
639 | m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); | 639 | m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); |
640 | m.insertSeparator(); | 640 | m.insertSeparator(); |
641 | m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); | 641 | m.insertItem( tr( "Delete" ), this, SLOT( localDelete() )); |
642 | m.insertSeparator(); | 642 | m.insertSeparator(); |
643 | m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); | 643 | m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); |
644 | m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); | 644 | m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); |
645 | m.setCheckable(TRUE); | 645 | m.setCheckable(TRUE); |
646 | if (b) | 646 | if (!b) |
647 | m.setItemChecked(m.idAt(0),TRUE); | 647 | m.setItemChecked(m.idAt(0),TRUE); |
648 | else | 648 | else |
649 | m.setItemChecked(m.idAt(0),FALSE); | 649 | m.setItemChecked(m.idAt(0),FALSE); |
650 | m.exec( QCursor::pos() ); | 650 | m.exec( QCursor::pos() ); |
651 | } | 651 | } |
652 | } | 652 | } |
653 | 653 | ||
654 | void AdvancedFm::showRemoteMenu(QListViewItem * item) | 654 | void AdvancedFm::showRemoteMenu(QListViewItem * item) |
655 | { | 655 | { |
656 | if(item) { | 656 | if(item) { |
657 | QPopupMenu m; | 657 | QPopupMenu m; |
658 | m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showRemoteHidden() )); | 658 | m.insertItem( tr( "Show Hidden Files" ), this, SLOT( showRemoteHidden() )); |
659 | m.insertSeparator(); | 659 | m.insertSeparator(); |
660 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) | 660 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) |
661 | m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); | 661 | m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); |
662 | else | 662 | else |
663 | m.insertItem( tr( "Open" ), this, SLOT( runThis() )); | 663 | m.insertItem( tr( "Open" ), this, SLOT( runThis() )); |
664 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); | 664 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); |
665 | m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 665 | m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
666 | m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); | 666 | m.insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); |
667 | m.insertItem( tr( "Copy" ), this, SLOT( copy() )); | 667 | m.insertItem( tr( "Copy" ), this, SLOT( copy() )); |
668 | m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); | 668 | m.insertItem( tr( "Copy As" ), this, SLOT( copyAs() )); |
669 | m.insertItem( tr( "Move" ), this, SLOT( move() )); | 669 | m.insertItem( tr( "Move" ), this, SLOT( move() )); |
670 | m.insertSeparator(); | 670 | m.insertSeparator(); |
671 | m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); | 671 | m.insertItem( tr( "Run Command" ), this, SLOT( runCommand() )); |
672 | m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); | 672 | m.insertItem( tr( "File Info" ), this, SLOT( fileStatus() )); |
673 | m.insertSeparator(); | 673 | m.insertSeparator(); |
674 | m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); | 674 | m.insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); |
675 | m.insertSeparator(); | 675 | m.insertSeparator(); |
676 | m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); | 676 | m.insertItem( tr( "Set Permissions" ), this, SLOT( filePerms() )); |
677 | m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); | 677 | m.insertItem( tr( "Properties" ), this, SLOT( doProperties() )); |
678 | m.setCheckable(TRUE); | 678 | m.setCheckable(TRUE); |
679 | if (b) | 679 | if (!b) |
680 | m.setItemChecked(m.idAt(0),TRUE); | 680 | m.setItemChecked(m.idAt(0),TRUE); |
681 | else | 681 | else |
682 | m.setItemChecked(m.idAt(0),FALSE); | 682 | m.setItemChecked(m.idAt(0),FALSE); |
683 | m.exec( QCursor::pos() ); | 683 | m.exec( QCursor::pos() ); |
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
687 | void AdvancedFm::runThis() { | 687 | void AdvancedFm::runThis() { |
688 | // QFileInfo *fi; | 688 | // QFileInfo *fi; |
689 | if (TabWidget->currentPageIndex() == 0) { | 689 | if (TabWidget->currentPageIndex() == 0) { |
690 | QString curFile = Local_View->currentItem()->text(0); | 690 | QString curFile = Local_View->currentItem()->text(0); |
691 | curFile = currentDir.canonicalPath()+"/"+curFile; | 691 | curFile = currentDir.canonicalPath()+"/"+curFile; |
692 | DocLnk nf(curFile); | 692 | DocLnk nf(curFile); |
693 | QString execStr = nf.exec(); | 693 | QString execStr = nf.exec(); |
694 | qDebug( execStr); | 694 | qDebug( execStr); |
695 | if( execStr.isEmpty() ) { | 695 | if( execStr.isEmpty() ) { |
696 | } else { | 696 | } else { |
697 | nf.execute(); | 697 | nf.execute(); |
698 | } | 698 | } |
699 | // MimeType mt( curFile); | 699 | // MimeType mt( curFile); |
700 | } else { | 700 | } else { |
701 | QString curFile = Remote_View->currentItem()->text(0); | 701 | QString curFile = Remote_View->currentItem()->text(0); |
702 | curFile = currentRemoteDir.canonicalPath()+"/"+curFile; | 702 | curFile = currentRemoteDir.canonicalPath()+"/"+curFile; |
703 | DocLnk nf(curFile); | 703 | DocLnk nf(curFile); |
704 | QString execStr = nf.exec(); | 704 | QString execStr = nf.exec(); |
705 | qDebug(execStr); | 705 | qDebug(execStr); |
706 | if( execStr.isEmpty() ) { | 706 | if( execStr.isEmpty() ) { |
707 | } else { | 707 | } else { |
708 | nf.execute(); | 708 | nf.execute(); |
709 | } | 709 | } |
710 | // MimeType mt( curFile); | 710 | // MimeType mt( curFile); |
711 | } | 711 | } |
712 | } | 712 | } |
713 | 713 | ||
714 | void AdvancedFm::runText() { | 714 | void AdvancedFm::runText() { |
715 | if (TabWidget->currentPageIndex() == 0) { | 715 | if (TabWidget->currentPageIndex() == 0) { |
716 | QString curFile = Local_View->currentItem()->text(0); | 716 | QString curFile = Local_View->currentItem()->text(0); |
717 | curFile = currentDir.canonicalPath()+"/"+curFile; | 717 | curFile = currentDir.canonicalPath()+"/"+curFile; |
718 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); | 718 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); |
719 | e << curFile; | 719 | e << curFile; |
720 | } else { | 720 | } else { |
721 | QString curFile = Remote_View->currentItem()->text(0); | 721 | QString curFile = Remote_View->currentItem()->text(0); |
722 | curFile = currentRemoteDir.canonicalPath()+"/"+curFile; | 722 | curFile = currentRemoteDir.canonicalPath()+"/"+curFile; |
723 | DocLnk nf(curFile); | 723 | DocLnk nf(curFile); |
724 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); | 724 | QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); |
725 | e << curFile; | 725 | e << curFile; |
726 | } | 726 | } |
727 | } | 727 | } |
728 | 728 | ||
729 | void AdvancedFm::localMakDir() | 729 | void AdvancedFm::localMakDir() |
730 | { | 730 | { |
731 | InputDialog *fileDlg; | 731 | InputDialog *fileDlg; |
732 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 732 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
733 | fileDlg->exec(); | 733 | fileDlg->exec(); |
734 | if( fileDlg->result() == 1 ) { | 734 | if( fileDlg->result() == 1 ) { |
735 | QString filename = fileDlg->LineEdit1->text(); | 735 | QString filename = fileDlg->LineEdit1->text(); |
736 | currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); | 736 | currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); |
737 | } | 737 | } |
738 | populateLocalView(); | 738 | populateLocalView(); |
739 | } | 739 | } |
740 | 740 | ||
741 | void AdvancedFm::remoteMakDir() | 741 | void AdvancedFm::remoteMakDir() |
742 | { | 742 | { |
743 | InputDialog *fileDlg; | 743 | InputDialog *fileDlg; |
744 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); | 744 | fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); |
745 | fileDlg->exec(); | 745 | fileDlg->exec(); |
746 | if( fileDlg->result() == 1 ) { | 746 | if( fileDlg->result() == 1 ) { |
747 | QString filename = fileDlg->LineEdit1->text(); | 747 | QString filename = fileDlg->LineEdit1->text(); |
748 | currentRemoteDir.mkdir( currentRemoteDir.canonicalPath()+"/"+filename); | 748 | currentRemoteDir.mkdir( currentRemoteDir.canonicalPath()+"/"+filename); |
749 | } | 749 | } |
750 | populateRemoteView(); | 750 | populateRemoteView(); |
751 | } | 751 | } |
752 | 752 | ||
753 | void AdvancedFm::localDelete() | 753 | void AdvancedFm::localDelete() |
754 | { | 754 | { |
755 | QString f = Local_View->currentItem()->text(0); | 755 | QString f = Local_View->currentItem()->text(0); |
756 | if(QDir(f).exists() ) { | 756 | if(QDir(f).exists() ) { |
757 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ | 757 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ |
758 | tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) { | 758 | tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) { |
759 | case 0: { | 759 | case 0: { |
760 | f=currentDir.canonicalPath()+"/"+f; | 760 | f=currentDir.canonicalPath()+"/"+f; |
761 | QString cmd="rmdir "+f; | 761 | QString cmd="rmdir "+f; |
762 | system( cmd.latin1()); | 762 | system( cmd.latin1()); |
763 | populateLocalView(); | 763 | populateLocalView(); |
764 | } | 764 | } |
765 | break; | 765 | break; |
766 | case 1: | 766 | case 1: |
767 | // exit | 767 | // exit |
768 | break; | 768 | break; |
769 | }; | 769 | }; |
770 | 770 | ||
771 | } else { | 771 | } else { |
772 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f | 772 | switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f |
773 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { | 773 | +" ?",tr("Yes"),tr("No"),0,0,1) ) { |
774 | case 0: { | 774 | case 0: { |
775 | f=currentDir.canonicalPath()+"/"+f; | 775 | f=currentDir.canonicalPath()+"/"+f; |