summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-24 22:30:34 (UTC)
committer llornkcor <llornkcor>2002-03-24 22:30:34 (UTC)
commit8cada0d43b00686567295e712f9c5c89e3977a7d (patch) (side-by-side diff)
treec68219b8731b391b8512b9454a62dde62f5dddc4
parent59e2a88589d8d3fce1a395d073516d99b4e46e78 (diff)
downloadopie-8cada0d43b00686567295e712f9c5c89e3977a7d.zip
opie-8cada0d43b00686567295e712f9c5c89e3977a7d.tar.gz
opie-8cada0d43b00686567295e712f9c5c89e3977a7d.tar.bz2
added symplink icon
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/textedit/fileBrowser.cpp12
-rw-r--r--core/apps/textedit/textedit.cpp2
2 files changed, 12 insertions, 2 deletions
diff --git a/core/apps/textedit/fileBrowser.cpp b/core/apps/textedit/fileBrowser.cpp
index eea7144..41e800c 100644
--- a/core/apps/textedit/fileBrowser.cpp
+++ b/core/apps/textedit/fileBrowser.cpp
@@ -174,52 +174,62 @@ void fileBrowser::populateList()
QFileInfoListIterator it(*list);
QFileInfo *fi;
while ( (fi=it.current()) ) {
if (fi->isSymLink() ){
QString symLink=fi->readLink();
// qDebug("Symlink detected "+symLink);
QFileInfo sym( symLink);
fileS.sprintf( "%10li", sym.size() );
fileL.sprintf( "%s -> %s", sym.fileName().data(),sym.absFilePath().data() );
fileDate = sym.lastModified().toString();
} else {
// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
fileS.sprintf( "%10li", fi->size() );
fileL.sprintf( "%s",fi->fileName().data() );
fileDate= fi->lastModified().toString();
if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
fileL+="/";
isDir=TRUE;
// qDebug( fileL);
}
}
if(fileL !="./") {
item= new QListViewItem( ListView,fileL,fileS , fileDate);
+ QPixmap pm;
+ pm= Resource::loadPixmap( "folder" );
if(isDir || fileL.find("/",0,TRUE) != -1)
- item->setPixmap( 0, Resource::loadPixmap( "folder" ));
+ item->setPixmap( 0,pm );
else
item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
+ if( fileL.find("->",0,TRUE) != -1) {
+ // overlay link image
+ QPixmap lnk = Resource::loadPixmap( "symlink" );
+ QPainter painter( &pm );
+ painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
+ pm.setMask( pm.createHeuristicMask( FALSE ) );
+ item->setPixmap( 0, pm);
+ }
}
isDir=FALSE;
++it;
}
ListView->setSorting( 3, FALSE);
QString currentPath = currentDir.canonicalPath();
fillCombo( (const QString &)currentPath);
// dirPathCombo->lineEdit()->setText(currentPath);
// if( dirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
// dirPathCombo->clear();
// dirPathStringList.prepend(currentPath );
// dirPathCombo->insertStringList( dirPathStringList,-1);
// }
}
void fileBrowser::upDir()
{
QString current = currentDir.canonicalPath();
QDir dir(current);
dir.cdUp();
current = dir.canonicalPath();
chdir( current.latin1() );
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index da74893..ecebe12 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -357,49 +357,49 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
connect( searchEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( search() ) );
a = new QAction( tr( "Find Next" ), Resource::loadPixmap( "next" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
a->addTo( searchBar );
a->addTo( edit );
a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
a->addTo( searchBar );
edit->insertSeparator();
a = new QAction( tr( "Delete" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
connect( a, SIGNAL( activated() ), this, SLOT( editDelete() ) );
a->addTo( edit );
searchBar->hide();
editor = new QpeEditor( this );
setCentralWidget( editor );
editor->setFrameStyle( QFrame::Panel | QFrame::Sunken );
connect( editor, SIGNAL( textChanged() ), this, SLOT( editorChanged() ) );
- resize( 200, 300 );
+// resize( 200, 300 );
// setFontSize(defsize,TRUE);
FontDatabase fdb;
QFont defaultFont=editor->font();
QFontInfo fontInfo(defaultFont);
cfg.setGroup("Font");
QString family = cfg.readEntry("Family", fontInfo.family());
QString style = cfg.readEntry("Style", fdb.styleString(defaultFont));
int i_size = cfg.readNumEntry("Size", fontInfo.pointSize()/10);
QString charSet = cfg.readEntry("CharSet", QFont::encodingName( fontInfo.charSet()) );
defaultFont = fdb.font(family,style,i_size,charSet);
editor->setFont( defaultFont);
wa->setOn(wrap);
updateCaption();
cfg.setGroup("View");
if(cfg.readEntry("startNew","TRUE") == "TRUE") {
nStart->setOn(TRUE);
fileNew();
} else {
fileOpen();