-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 17 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index bb7f346..1a5e131 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -28,12 +28,13 @@ | |||
28 | #include <qpe/applnk.h> | 28 | #include <qpe/applnk.h> |
29 | #include <qpe/ir.h> | 29 | #include <qpe/ir.h> |
30 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
31 | #include <qpe/menubutton.h> | 31 | #include <qpe/menubutton.h> |
32 | 32 | ||
33 | 33 | ||
34 | #include <qwmatrix.h> | ||
34 | #include <qregexp.h> | 35 | #include <qregexp.h> |
35 | #include <qtabwidget.h> | 36 | #include <qtabwidget.h> |
36 | #include <qtextstream.h> | 37 | #include <qtextstream.h> |
37 | #include <qpushbutton.h> | 38 | #include <qpushbutton.h> |
38 | #include <qdatetime.h> | 39 | #include <qdatetime.h> |
39 | #include <qdir.h> | 40 | #include <qdir.h> |
@@ -70,12 +71,17 @@ | |||
70 | 71 | ||
71 | AdvancedFm::AdvancedFm( ) | 72 | AdvancedFm::AdvancedFm( ) |
72 | : QMainWindow( ) { | 73 | : QMainWindow( ) { |
73 | init(); | 74 | init(); |
74 | renameBox = 0; | 75 | renameBox = 0; |
75 | 76 | ||
77 | QWMatrix matrix; | ||
78 | QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); | ||
79 | matrix.scale( .4, .4); | ||
80 | unknownXpm = pix.xForm(matrix); | ||
81 | |||
76 | initConnections(); | 82 | initConnections(); |
77 | whichTab=1; | 83 | whichTab=1; |
78 | rePopulate(); | 84 | rePopulate(); |
79 | currentPathCombo->setFocus(); | 85 | currentPathCombo->setFocus(); |
80 | } | 86 | } |
81 | 87 | ||
@@ -187,26 +193,27 @@ void AdvancedFm::populateView() | |||
187 | { | 193 | { |
188 | pm = Resource::loadPixmap( "locked" ); | 194 | pm = Resource::loadPixmap( "locked" ); |
189 | } | 195 | } |
190 | else { //everything else goes by mimetype | 196 | else { //everything else goes by mimetype |
191 | MimeType mt(fi->filePath()); | 197 | MimeType mt(fi->filePath()); |
192 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 198 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
193 | if(pm.isNull()) | 199 | if(pm.isNull()) { |
194 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 200 | pm = unknownXpm; |
201 | } | ||
195 | } | 202 | } |
196 | item->setPixmap( 0,pm); | ||
197 | if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) | 203 | if( fi->isSymLink() && fileL.find("->",0,TRUE) != -1) |
198 | { | 204 | { |
199 | // overlay link image | 205 | // overlay link image |
200 | pm= Resource::loadPixmap( "folder" ); | 206 | pm= Resource::loadPixmap( "folder" ); |
201 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 207 | QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
202 | QPainter painter( &pm ); | 208 | QPainter painter( &pm ); |
203 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 209 | painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
204 | pm.setMask( pm.createHeuristicMask( FALSE ) ); | 210 | pm.setMask( pm.createHeuristicMask( FALSE ) ); |
205 | item->setPixmap( 0, pm); | ||
206 | } | 211 | } |
212 | item->setPixmap( 0,pm); | ||
213 | |||
207 | } | 214 | } |
208 | isDir=FALSE; | 215 | isDir=FALSE; |
209 | ++it; | 216 | ++it; |
210 | } | 217 | } |
211 | 218 | ||
212 | if( path.find("dev",0,TRUE) != -1) | 219 | if( path.find("dev",0,TRUE) != -1) |
@@ -225,13 +232,13 @@ void AdvancedFm::populateView() | |||
225 | devT = buf.st_dev; | 232 | devT = buf.st_dev; |
226 | fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); | 233 | fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); |
227 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); | 234 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); |
228 | if( fileL.find(".") == -1 ) | 235 | if( fileL.find(".") == -1 ) |
229 | { | 236 | { |
230 | item= new QListViewItem( thisView, fileL, fileS, fileDate); | 237 | item= new QListViewItem( thisView, fileL, fileS, fileDate); |
231 | pm = Resource::loadPixmap( "UnknownDocument-14" ); | 238 | pm = unknownXpm; |
232 | item->setPixmap( 0,pm); | 239 | item->setPixmap( 0,pm); |
233 | } | 240 | } |
234 | } | 241 | } |
235 | 242 | ||
236 | closedir(dir); | 243 | closedir(dir); |
237 | } | 244 | } |
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index f31956c..c30d8e0 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h | |||
@@ -23,12 +23,13 @@ | |||
23 | #include <qmainwindow.h> | 23 | #include <qmainwindow.h> |
24 | #include <qstringlist.h> | 24 | #include <qstringlist.h> |
25 | #include <qdir.h> | 25 | #include <qdir.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qpoint.h> | 27 | #include <qpoint.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qpixmap.h> | ||
29 | 30 | ||
30 | class OTabWidget; | 31 | class OTabWidget; |
31 | class QVBoxLayout; | 32 | class QVBoxLayout; |
32 | class QHBoxLayout; | 33 | class QHBoxLayout; |
33 | class QGridLayout; | 34 | class QGridLayout; |
34 | class QComboBox; | 35 | class QComboBox; |
@@ -88,12 +89,13 @@ protected slots: | |||
88 | void switchToLocalTab(); | 89 | void switchToLocalTab(); |
89 | void switchToRemoteTab(); | 90 | void switchToRemoteTab(); |
90 | 91 | ||
91 | protected: | 92 | protected: |
92 | 93 | ||
93 | OTabWidget *TabWidget; | 94 | OTabWidget *TabWidget; |
95 | QPixmap unknownXpm; | ||
94 | int whichTab; | 96 | int whichTab; |
95 | // QTabWidget *TabWidget; | 97 | // QTabWidget *TabWidget; |
96 | QWidget *tab, *tab_2, *tab_3; | 98 | QWidget *tab, *tab_2, *tab_3; |
97 | QListView *Local_View, *Remote_View; | 99 | QListView *Local_View, *Remote_View; |
98 | 100 | ||
99 | QLineEdit *currentPathEdit; | 101 | QLineEdit *currentPathEdit; |