Diffstat (limited to 'microkde/ofileselector_p.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/ofileselector_p.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp index cf6074d..fd5f965 100644 --- a/microkde/ofileselector_p.cpp +++ b/microkde/ofileselector_p.cpp | |||
@@ -11,24 +11,26 @@ | |||
11 | #include <qregexp.h> | 11 | #include <qregexp.h> |
12 | #include <qobjectlist.h> | 12 | #include <qobjectlist.h> |
13 | 13 | ||
14 | /* hacky but we need to get FileSelector::filter */ | 14 | /* hacky but we need to get FileSelector::filter */ |
15 | #define private public | 15 | #define private public |
16 | #include <qpe/fileselector.h> | 16 | #include <qpe/fileselector.h> |
17 | #undef private | 17 | #undef private |
18 | 18 | ||
19 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
20 | #include <qpe/mimetype.h> | 20 | #include <qpe/mimetype.h> |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #include <qpe/storage.h> | 22 | #include <qpe/storage.h> |
23 | #include <kglobal.h> | ||
24 | #include <klocale.h> | ||
23 | 25 | ||
24 | #include "ofileselector_p.h" | 26 | #include "ofileselector_p.h" |
25 | //US#include "ofileselector.h" | 27 | //US#include "ofileselector.h" |
26 | 28 | ||
27 | #include "klocale.h" | 29 | #include "klocale.h" |
28 | 30 | ||
29 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) | 31 | OFileViewInterface::OFileViewInterface( OFileSelector* selector ) |
30 | : m_selector( selector ) { | 32 | : m_selector( selector ) { |
31 | } | 33 | } |
32 | OFileViewInterface::~OFileViewInterface() { | 34 | OFileViewInterface::~OFileViewInterface() { |
33 | } | 35 | } |
34 | QString OFileViewInterface::name()const{ | 36 | QString OFileViewInterface::name()const{ |
@@ -458,45 +460,46 @@ void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { | |||
458 | dir = info->dirPath( true ); | 460 | dir = info->dirPath( true ); |
459 | locked = false; | 461 | locked = false; |
460 | if ( symlink ) | 462 | if ( symlink ) |
461 | name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); | 463 | name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); |
462 | else{ | 464 | else{ |
463 | name = info->fileName(); | 465 | name = info->fileName(); |
464 | if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || | 466 | if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || |
465 | ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) { | 467 | ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) { |
466 | locked = true; pix = Resource::loadPixmap("locked"); | 468 | locked = true; pix = Resource::loadPixmap("locked"); |
467 | } | 469 | } |
468 | } | 470 | } |
469 | (void)new OFileSelectorItem( m_view, pix, name, | 471 | (void)new OFileSelectorItem( m_view, pix, name, |
470 | info->lastModified().toString(), QString::number( info->size() ), | 472 | KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate), |
473 | QString::number( info->size() ), | ||
471 | dir, locked ); | 474 | dir, locked ); |
472 | } | 475 | } |
473 | void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) { | 476 | void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) { |
474 | bool locked = false; QString name; QPixmap pix; | 477 | bool locked = false; QString name; QPixmap pix; |
475 | 478 | ||
476 | if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || | 479 | if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || |
477 | ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) { | 480 | ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) { |
478 | locked = true; | 481 | locked = true; |
479 | if ( symlink ) | 482 | if ( symlink ) |
480 | pix = Resource::loadPixmap( "symlink" ); | 483 | pix = Resource::loadPixmap( "symlink" ); |
481 | else | 484 | else |
482 | pix = Resource::loadPixmap( "lockedfolder" ); | 485 | pix = Resource::loadPixmap( "lockedfolder" ); |
483 | }else | 486 | }else |
484 | pix = symlink ? Resource::loadPixmap( "symlink") : Resource::loadPixmap("folder"); | 487 | pix = symlink ? Resource::loadPixmap( "symlink") : Resource::loadPixmap("folder"); |
485 | 488 | ||
486 | name = symlink ? info->fileName() + " -> " + info->dirPath(true) + "/" + info->readLink() : | 489 | name = symlink ? info->fileName() + " -> " + info->dirPath(true) + "/" + info->readLink() : |
487 | info->fileName(); | 490 | info->fileName(); |
488 | 491 | ||
489 | (void)new OFileSelectorItem( m_view, pix, name, | 492 | (void)new OFileSelectorItem( m_view, pix, name, |
490 | info->lastModified().toString(), | 493 | KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate), |
491 | QString::number( info->size() ), | 494 | QString::number( info->size() ), |
492 | info->dirPath( true ), locked, true ); | 495 | info->dirPath( true ), locked, true ); |
493 | 496 | ||
494 | 497 | ||
495 | } | 498 | } |
496 | void OFileViewFileListView::addSymlink( QFileInfo* , bool ) { | 499 | void OFileViewFileListView::addSymlink( QFileInfo* , bool ) { |
497 | 500 | ||
498 | } | 501 | } |
499 | void OFileViewFileListView::cdUP() { | 502 | void OFileViewFileListView::cdUP() { |
500 | QDir dir( m_currentDir ); | 503 | QDir dir( m_currentDir ); |
501 | dir.cdUp(); | 504 | dir.cdUp(); |
502 | 505 | ||