summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-04-14 03:24:23 (UTC)
committer kergoth <kergoth>2002-04-14 03:24:23 (UTC)
commit908a0fb11fd33161a3899f29c11cfbec9dcadbfc (patch) (unidiff)
tree915acafe981ba9e381ff54ceaf5f2aeb1cdc15bf
parent02fc6c820f98d58e856f410e3f1167027f084bec (diff)
downloadopie-908a0fb11fd33161a3899f29c11cfbec9dcadbfc.zip
opie-908a0fb11fd33161a3899f29c11cfbec9dcadbfc.tar.gz
opie-908a0fb11fd33161a3899f29c11cfbec9dcadbfc.tar.bz2
Fixing policy violation.. no app pics in the root of pics/\!
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/filebrowser/filebrowser.cpp2
-rw-r--r--noncore/unsupported/filebrowser/opie-filebrowser.control2
-rw-r--r--pics/filebrowser/symlink.png (renamed from pics/symlink.png)bin103 -> 103 bytes
3 files changed, 2 insertions, 2 deletions
diff --git a/noncore/unsupported/filebrowser/filebrowser.cpp b/noncore/unsupported/filebrowser/filebrowser.cpp
index 34d5177..d9e2afa 100644
--- a/noncore/unsupported/filebrowser/filebrowser.cpp
+++ b/noncore/unsupported/filebrowser/filebrowser.cpp
@@ -27,129 +27,129 @@
27#include <qpe/applnk.h> 27#include <qpe/applnk.h>
28#include <qpe/config.h> 28#include <qpe/config.h>
29 29
30#include <qcopchannel_qws.h> 30#include <qcopchannel_qws.h>
31#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
32 32
33#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qdir.h> 34#include <qdir.h>
35#include <qregexp.h> 35#include <qregexp.h>
36#include <qheader.h> 36#include <qheader.h>
37#include <qpe/qpetoolbar.h> 37#include <qpe/qpetoolbar.h>
38#include <qpopupmenu.h> 38#include <qpopupmenu.h>
39#include <qpe/qpemenubar.h> 39#include <qpe/qpemenubar.h>
40#include <qaction.h> 40#include <qaction.h>
41#include <qstringlist.h> 41#include <qstringlist.h>
42#include <qcursor.h> 42#include <qcursor.h>
43#include <qmultilineedit.h> 43#include <qmultilineedit.h>
44#include <qfont.h> 44#include <qfont.h>
45 45
46#include <unistd.h> 46#include <unistd.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <sys/stat.h> 48#include <sys/stat.h>
49 49
50// 50//
51// FileItem 51// FileItem
52// 52//
53FileItem::FileItem( QListView * parent, const QFileInfo & fi ) 53FileItem::FileItem( QListView * parent, const QFileInfo & fi )
54 : QListViewItem( parent ), 54 : QListViewItem( parent ),
55 fileInfo( fi ) 55 fileInfo( fi )
56{ 56{
57 QDate d = fi.lastModified().date(); 57 QDate d = fi.lastModified().date();
58 58
59 setText( 0, fi.fileName() ); 59 setText( 0, fi.fileName() );
60 setText( 1, sizeString( fi.size() ) + " " ); 60 setText( 1, sizeString( fi.size() ) + " " );
61 setText( 2, QString().sprintf("%4d-%02d-%02d",d.year(), d.month(), d.day() ) ); 61 setText( 2, QString().sprintf("%4d-%02d-%02d",d.year(), d.month(), d.day() ) );
62 62
63 MimeType mt(fi.filePath()); 63 MimeType mt(fi.filePath());
64 64
65 if ( fi.isSymLink() ) 65 if ( fi.isSymLink() )
66 setText( 3, "symlink" ); 66 setText( 3, "symlink" );
67 else if( fi.isDir() ) 67 else if( fi.isDir() )
68 setText( 3, "directory" ); 68 setText( 3, "directory" );
69 else if( isLib() ) 69 else if( isLib() )
70 setText( 3, "library" ); 70 setText( 3, "library" );
71 else 71 else
72 setText( 3, mt.description() ); 72 setText( 3, mt.description() );
73 73
74 QPixmap pm; 74 QPixmap pm;
75 if( fi.isDir() ){ 75 if( fi.isDir() ){
76 if( !QDir( fi.filePath() ).isReadable() ) 76 if( !QDir( fi.filePath() ).isReadable() )
77 pm = Resource::loadPixmap( "lockedfolder" ); 77 pm = Resource::loadPixmap( "lockedfolder" );
78 else 78 else
79 pm = Resource::loadPixmap( "folder" ); 79 pm = Resource::loadPixmap( "folder" );
80 } 80 }
81 else if( !fi.isReadable() ) 81 else if( !fi.isReadable() )
82 pm = Resource::loadPixmap( "locked" ); 82 pm = Resource::loadPixmap( "locked" );
83 else if( isLib() ) 83 else if( isLib() )
84 pm = Resource::loadPixmap( "library" ); 84 pm = Resource::loadPixmap( "library" );
85 else 85 else
86 pm = mt.pixmap(); 86 pm = mt.pixmap();
87 if ( pm.isNull() ) 87 if ( pm.isNull() )
88 pm = Resource::loadPixmap("UnknownDocument-14"); 88 pm = Resource::loadPixmap("UnknownDocument-14");
89 if( fi.isSymLink() ){ 89 if( fi.isSymLink() ){
90 // overlay link image 90 // overlay link image
91 QPixmap lnk = Resource::loadPixmap( "symlink" ); 91 QPixmap lnk = Resource::loadPixmap( "filebrowser/symlink" );
92 QPainter painter( &pm ); 92 QPainter painter( &pm );
93 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 93 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
94 pm.setMask( pm.createHeuristicMask( FALSE ) ); 94 pm.setMask( pm.createHeuristicMask( FALSE ) );
95 } 95 }
96 setPixmap(0,pm); 96 setPixmap(0,pm);
97} 97}
98 98
99QString FileItem::sizeString( unsigned int s ) 99QString FileItem::sizeString( unsigned int s )
100{ 100{
101 double size = s; 101 double size = s;
102 102
103 if ( size > 1024 * 1024 * 1024 ) 103 if ( size > 1024 * 1024 * 1024 )
104 return QString().sprintf( "%.1f", size / ( 1024 * 1024 * 1024 ) ) + "G"; 104 return QString().sprintf( "%.1f", size / ( 1024 * 1024 * 1024 ) ) + "G";
105 else if ( size > 1024 * 1024 ) 105 else if ( size > 1024 * 1024 )
106 return QString().sprintf( "%.1f", size / ( 1024 * 1024 ) ) + "M"; 106 return QString().sprintf( "%.1f", size / ( 1024 * 1024 ) ) + "M";
107 else if ( size > 1024 ) 107 else if ( size > 1024 )
108 return QString().sprintf( "%.1f", size / ( 1024 ) ) + "K"; 108 return QString().sprintf( "%.1f", size / ( 1024 ) ) + "K";
109 else 109 else
110 return QString::number( size ) + "B"; 110 return QString::number( size ) + "B";
111} 111}
112 112
113QString FileItem::key( int column, bool ascending ) const 113QString FileItem::key( int column, bool ascending ) const
114{ 114{
115 QString tmp; 115 QString tmp;
116 116
117 ascending = ascending; 117 ascending = ascending;
118 118
119 if( (column == 0) && fileInfo.isDir() ){ // Sort by name 119 if( (column == 0) && fileInfo.isDir() ){ // Sort by name
120 // We want the directories to appear at the top of the list 120 // We want the directories to appear at the top of the list
121 tmp = (char) 0; 121 tmp = (char) 0;
122 return (tmp + text( column ).lower()); 122 return (tmp + text( column ).lower());
123 } 123 }
124 else if( column == 2 ) { // Sort by date 124 else if( column == 2 ) { // Sort by date
125 QDateTime epoch( QDate( 1980, 1, 1 ) ); 125 QDateTime epoch( QDate( 1980, 1, 1 ) );
126 tmp.sprintf( "%08d", epoch.secsTo( fileInfo.lastModified() ) ); 126 tmp.sprintf( "%08d", epoch.secsTo( fileInfo.lastModified() ) );
127 return tmp; 127 return tmp;
128 } 128 }
129 else if( column == 1 ) { // Sort by size 129 else if( column == 1 ) { // Sort by size
130 return tmp.sprintf( "%08d", fileInfo.size() ); 130 return tmp.sprintf( "%08d", fileInfo.size() );
131 } 131 }
132 132
133 return text( column ).lower(); 133 return text( column ).lower();
134} 134}
135 135
136bool FileItem::isLib() 136bool FileItem::isLib()
137{ 137{
138 // This is of course not foolproof 138 // This is of course not foolproof
139 if( !qstrncmp("lib", fileInfo.baseName(), 3) && 139 if( !qstrncmp("lib", fileInfo.baseName(), 3) &&
140 ( fileInfo.extension().contains( "so" ) || 140 ( fileInfo.extension().contains( "so" ) ||
141 fileInfo.extension().contains( "a" ) ) ) 141 fileInfo.extension().contains( "a" ) ) )
142 return TRUE; 142 return TRUE;
143 else 143 else
144 return FALSE; 144 return FALSE;
145} 145}
146 146
147int FileItem::launch() 147int FileItem::launch()
148{ 148{
149 DocLnk doc( fileInfo.filePath(), FALSE ); 149 DocLnk doc( fileInfo.filePath(), FALSE );
150 doc.execute(); 150 doc.execute();
151 listView()->clearSelection(); 151 listView()->clearSelection();
152 return 1; 152 return 1;
153} 153}
154 154
155bool FileItem::rename( const QString & name ) 155bool FileItem::rename( const QString & name )
diff --git a/noncore/unsupported/filebrowser/opie-filebrowser.control b/noncore/unsupported/filebrowser/opie-filebrowser.control
index c15ae17..9de926f 100644
--- a/noncore/unsupported/filebrowser/opie-filebrowser.control
+++ b/noncore/unsupported/filebrowser/opie-filebrowser.control
@@ -1,9 +1,9 @@
1Files: bin/filebrowser apps/Applications/filebrowser.desktop 1Files: bin/filebrowser apps/Applications/filebrowser.desktop pics/filebrowser/symlink.png
2Priority: optional 2Priority: optional
3Section: opie/applications 3Section: opie/applications
4Maintainer: Warwick Allison <warwick@trolltech.com> 4Maintainer: Warwick Allison <warwick@trolltech.com>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION 6Version: $QPE_VERSION-$SUB_VERSION
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
8Description: Browse the file system 8Description: Browse the file system
9 The filebrowser for the Opie environment. 9 The filebrowser for the Opie environment.
diff --git a/pics/symlink.png b/pics/filebrowser/symlink.png
index a0b267a..a0b267a 100644
--- a/pics/symlink.png
+++ b/pics/filebrowser/symlink.png
Binary files differ