summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-18 16:38:24 (UTC)
committer zautrix <zautrix>2005-06-18 16:38:24 (UTC)
commit1919ddd25fb835b0eb03a44cbfbf4713d45266b8 (patch) (side-by-side diff)
treef2ed65d2ad6b204dcb7eeb76da8776aae69aba6c
parent4ad2d49928757d72657735e088ac1cf587637fca (diff)
downloadkdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.zip
kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.tar.gz
kdepimpi-1919ddd25fb835b0eb03a44cbfbf4713d45266b8.tar.bz2
fixed links
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--microkde/ofileselector_p.cpp34
2 files changed, 30 insertions, 7 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index eaf4b56..dd02be5 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -9,8 +9,11 @@ If in TodoView is selected "do not show compledted todos" then completed todos a
KA/Pi:
In the addressee selection dialog now the formatted name is shown, if not empty.
+Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
+Fixed the sorting for size in the file selector on the Z.
+
********** VERSION 2.1.7 ************
KO/Pi:
Fixed several problems in the new Resource handling.
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
@@ -155,12 +155,25 @@ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap,
const QString& size, const QString& dir,
bool isLocked, bool isDir )
: 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;
m_locked = isLocked;
}
@@ -189,9 +202,14 @@ QString OFileSelectorItem::key( int id, bool )const {
ke.append("1" );
ke.append( text(1) );
}
return ke;
- }else
+ } else if ( id == 2 ) {
+ QString sort = "00000000";
+ sort = sort.left( 9-text( 2 ).length()) + text( 2 );
+ return sort;
+
+ } else
return text( id );
}
@@ -344,11 +362,13 @@ void OFileViewFileListView::reread( bool all ) {
* It is a symlink we try to resolve it now but don't let us attack by DOS
*
*/
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 );
break;
}else if( info.isDir() ){
@@ -357,9 +377,9 @@ void OFileViewFileListView::reread( bool all ) {
}else if( info.isFile() ){
addFile( fi, TRUE );
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
addSymlink( fi );
}
@@ -485,9 +505,9 @@ void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) {
}
dir = info->dirPath( true );
locked = false;
if ( symlink )
- name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink();
+ name = info->fileName() + " -> " + info->readLink();
else{
name = info->fileName();
if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) ||
( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) {
@@ -511,9 +531,9 @@ void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) {
pix = Resource::loadPixmap( "lockedfolder" );
}else
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();
(void)new OFileSelectorItem( m_view, pix, name,
KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate),