author | zautrix <zautrix> | 2005-06-18 16:38:24 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-18 16:38:24 (UTC) |
commit | 1919ddd25fb835b0eb03a44cbfbf4713d45266b8 (patch) (side-by-side diff) | |
tree | f2ed65d2ad6b204dcb7eeb76da8776aae69aba6c /microkde | |
parent | 4ad2d49928757d72657735e088ac1cf587637fca (diff) | |
download | kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.zip kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.tar.gz kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.tar.bz2 |
fixed links
-rw-r--r-- | microkde/ofileselector_p.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp index f85f8f4..e2af32b 100644 --- a/microkde/ofileselector_p.cpp +++ b/microkde/ofileselector_p.cpp @@ -157,8 +157,21 @@ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, : QListViewItem( view ) { + + QString kind; + QString _path = path; + if ( isDir ) + kind = "dir"; + else + kind = "file"; setPixmap(0, pixmap ); - setText(1, path ); + int arrow = path.find( "->" ); + if (arrow > 0 ) { + kind += path.mid( arrow ); + _path = path.left(arrow); + } + setText(1, _path ); setText(2, size ); setText(3, date ); + setText(4, kind ); m_isDir = isDir; m_dir = dir; @@ -191,4 +204,9 @@ QString OFileSelectorItem::key( int id, bool )const { } return ke; + } else if ( id == 2 ) { + QString sort = "00000000"; + sort = sort.left( 9-text( 2 ).length()) + text( 2 ); + return sort; + }else return text( id ); @@ -346,7 +364,9 @@ void OFileViewFileListView::reread( bool all ) { */ if( fi->isSymLink() ){ - QString file = fi->dirPath( true ) + "/" + fi->readLink(); - for( int i = 0; i<=4; i++) { // 5 tries to prevent dos + qDebug("SYMLINK "); + QString file = fi->readLink(); + for( int i = 0; i<=5; i++) { // 5 tries to prevent dos QFileInfo info( file ); + qDebug("FILE %s ", file.latin1()); if( !info.exists() ){ addSymlink( fi, TRUE ); @@ -359,5 +379,5 @@ void OFileViewFileListView::reread( bool all ) { break; }else if( info.isSymLink() ){ - file = info.dirPath(true ) + "/" + info.readLink() ; + file = info.readLink() ; break; }else if( i == 4){ // couldn't resolve symlink add it as symlink @@ -487,5 +507,5 @@ void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { locked = false; if ( symlink ) - name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); + name = info->fileName() + " -> " + info->readLink(); else{ name = info->fileName(); @@ -513,5 +533,5 @@ void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) { pix = symlink ? Resource::loadPixmap( "symlink") : Resource::loadPixmap("folder"); - name = symlink ? info->fileName() + " -> " + info->dirPath(true) + "/" + info->readLink() : + name = symlink ? info->fileName() + " -> " + info->readLink() : info->fileName(); |