summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
authorllornkcor <llornkcor>2004-09-25 06:18:09 (UTC)
committer llornkcor <llornkcor>2004-09-25 06:18:09 (UTC)
commitc47a2d0e8ec283737f7c43474be4cf8070cde046 (patch) (unidiff)
tree3555656a8cc575c04432894eccbd7d4514560365 /noncore/apps/advancedfm
parent0671201a4527973c41adad5f5681938da7f1f824 (diff)
downloadopie-c47a2d0e8ec283737f7c43474be4cf8070cde046.zip
opie-c47a2d0e8ec283737f7c43474be4cf8070cde046.tar.gz
opie-c47a2d0e8ec283737f7c43474be4cf8070cde046.tar.bz2
remove
Diffstat (limited to 'noncore/apps/advancedfm') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp7
-rw-r--r--noncore/apps/advancedfm/advancedfm.h1
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp2
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp220
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
@@ -322,11 +322,4 @@ void AdvancedFm::fillCombo(const QString &currentPath) {
322} 322}
323 323
324void AdvancedFm::currentPathComboActivated(const QString & currentPath) {
325 chdir( currentPath.latin1() );
326 CurrentDir()->cd( currentPath, TRUE);
327 populateView();
328 update();
329}
330
331QStringList AdvancedFm::getPath() { 324QStringList AdvancedFm::getPath() {
332 QStringList strList; 325 QStringList strList;
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
@@ -154,5 +154,4 @@ protected slots:
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 & );
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
@@ -256,5 +256,5 @@ void AdvancedFm::initConnections()
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()));
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
@@ -51,65 +51,65 @@ void AdvancedFm::doDirChange() {
51 51
52void AdvancedFm::showMenuHidden() { 52void 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
66void AdvancedFm::showHidden() { 66void 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
77QString AdvancedFm::dealWithSymName(const QString &fileName) { 77QString 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
82void AdvancedFm::runThis() { 82void 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 }
@@ -118,24 +118,24 @@ void AdvancedFm::runThis() {
118 118
119void AdvancedFm::runText() { 119void 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
131void AdvancedFm::makeDir() { 131void 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}
@@ -260,14 +260,8 @@ void AdvancedFm::doProperties() {
260 260
261void AdvancedFm::upDir() { 261void 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
@@ -277,61 +271,61 @@ void AdvancedFm::copyTimer() {
277 271
278void AdvancedFm::copy() { 272void 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