Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index c44d387..2ba3dca 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -4,98 +4,98 @@ | |||
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #define DEVELOPERS_VERSION | 12 | #define DEVELOPERS_VERSION |
13 | #include "advancedfm.h" | 13 | #include "advancedfm.h" |
14 | 14 | ||
15 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/config.h> | 16 | #include <qpe/config.h> |
17 | #include <qpe/mimetype.h> | 17 | #include <qpe/mimetype.h> |
18 | #include <qpe/applnk.h> | 18 | #include <qpe/applnk.h> |
19 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
20 | #include <qpe/menubutton.h> | 20 | #include <qpe/menubutton.h> |
21 | 21 | ||
22 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
23 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
24 | #include <qlistview.h> | 24 | #include <qlistview.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | 27 | ||
28 | 28 | ||
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #include <time.h> | 30 | #include <time.h> |
31 | #include <dirent.h> | 31 | #include <dirent.h> |
32 | #include <fcntl.h> | 32 | #include <fcntl.h> |
33 | #include <sys/vfs.h> | 33 | #include <sys/vfs.h> |
34 | #include <mntent.h> | 34 | #include <mntent.h> |
35 | 35 | ||
36 | #ifdef NOQUICKLAUNCH | 36 | #ifdef NOQUICKLAUNCH |
37 | AdvancedFm::AdvancedFm( ) | 37 | AdvancedFm::AdvancedFm( ) |
38 | #else | 38 | #else |
39 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | 39 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) |
40 | #endif | 40 | #endif |
41 | : QMainWindow( ) { | 41 | : QMainWindow( ) { |
42 | init(); | 42 | init(); |
43 | renameBox = 0; | 43 | renameBox = 0; |
44 | 44 | ||
45 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 45 | unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
46 | 46 | ||
47 | initConnections(); | 47 | initConnections(); |
48 | whichTab=1; | 48 | whichTab=1; |
49 | rePopulate(); | 49 | rePopulate(); |
50 | currentPathCombo->setFocus(); | 50 | currentPathCombo->setFocus(); |
51 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); | 51 | channel = new QCopChannel( "QPE/Application/advancedfm", this ); |
52 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 52 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
53 | this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); | 53 | this, SLOT( qcopReceive(const QCString&,const QByteArray&)) ); |
54 | } | 54 | } |
55 | 55 | ||
56 | AdvancedFm::~AdvancedFm() { | 56 | AdvancedFm::~AdvancedFm() { |
57 | } | 57 | } |
58 | 58 | ||
59 | 59 | ||
60 | void AdvancedFm::cleanUp() { | 60 | void AdvancedFm::cleanUp() { |
61 | QString sfile=QDir::homeDirPath(); | 61 | QString sfile=QDir::homeDirPath(); |
62 | if(sfile.right(1) != "/") | 62 | if(sfile.right(1) != "/") |
63 | sfile+="/._temp"; | 63 | sfile+="/._temp"; |
64 | else | 64 | else |
65 | sfile+="._temp"; | 65 | sfile+="._temp"; |
66 | QFile file( sfile); | 66 | QFile file( sfile); |
67 | if(file.exists()) | 67 | if(file.exists()) |
68 | file.remove(); | 68 | file.remove(); |
69 | } | 69 | } |
70 | 70 | ||
71 | void AdvancedFm::tabChanged(QWidget *) { | 71 | void AdvancedFm::tabChanged(QWidget *) { |
72 | // qWarning("tab changed"); | 72 | // qWarning("tab changed"); |
73 | QString path = CurrentDir()->canonicalPath(); | 73 | QString path = CurrentDir()->canonicalPath(); |
74 | currentPathCombo->lineEdit()->setText( path ); | 74 | currentPathCombo->lineEdit()->setText( path ); |
75 | 75 | ||
76 | if(whichTab == 1) { | 76 | if(whichTab == 1) { |
77 | viewMenu->setItemChecked(viewMenu->idAt(0), true); | 77 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
78 | viewMenu->setItemChecked(viewMenu->idAt(1), false); | 78 | viewMenu->setItemChecked(viewMenu->idAt(1), false); |
79 | } else { | 79 | } else { |
80 | viewMenu->setItemChecked(viewMenu->idAt(0), false); | 80 | viewMenu->setItemChecked(viewMenu->idAt(0), false); |
81 | viewMenu->setItemChecked(viewMenu->idAt(1), true); | 81 | viewMenu->setItemChecked(viewMenu->idAt(1), true); |
82 | } | 82 | } |
83 | 83 | ||
84 | QString fs= getFileSystemType( (const QString &) path); | 84 | QString fs= getFileSystemType( (const QString &) path); |
85 | 85 | ||
86 | setCaption(tr("AdvancedFm :: ")+fs+" :: " | 86 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
87 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); | 87 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); |
88 | chdir( path.latin1()); | 88 | chdir( path.latin1()); |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | void AdvancedFm::populateView() { | 92 | void AdvancedFm::populateView() { |
93 | 93 | ||
94 | // qWarning("PopulateView"); | 94 | // qWarning("PopulateView"); |
95 | QPixmap pm; | 95 | QPixmap pm; |
96 | QListView *thisView = CurrentView(); | 96 | QListView *thisView = CurrentView(); |
97 | QDir *thisDir = CurrentDir(); | 97 | QDir *thisDir = CurrentDir(); |
98 | QString path = thisDir->canonicalPath(); | 98 | QString path = thisDir->canonicalPath(); |
99 | 99 | ||
100 | //qWarning("path is "+path); | 100 | //qWarning("path is "+path); |
101 | thisView->clear(); | 101 | thisView->clear(); |