-rw-r--r-- | microkde/microkde.pro | 2 | ||||
-rw-r--r-- | microkde/ofileselector_p.cpp | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/microkde/microkde.pro b/microkde/microkde.pro index 71d662b..21da158 100644 --- a/microkde/microkde.pro +++ b/microkde/microkde.pro | |||
@@ -52,65 +52,64 @@ KDGanttMinimizeSplitter.h \ | |||
52 | krestrictedline.h \ | 52 | krestrictedline.h \ |
53 | krun.h \ | 53 | krun.h \ |
54 | ksimpleconfig.h \ | 54 | ksimpleconfig.h \ |
55 | kstaticdeleter.h \ | 55 | kstaticdeleter.h \ |
56 | ksystemtray.h \ | 56 | ksystemtray.h \ |
57 | ktempfile.h \ | 57 | ktempfile.h \ |
58 | ktextedit.h \ | 58 | ktextedit.h \ |
59 | kunload.h \ | 59 | kunload.h \ |
60 | kurl.h \ | 60 | kurl.h \ |
61 | kdeui/kguiitem.h \ | 61 | kdeui/kguiitem.h \ |
62 | kdeui/kcmodule.h \ | 62 | kdeui/kcmodule.h \ |
63 | kdeui/kbuttonbox.h \ | 63 | kdeui/kbuttonbox.h \ |
64 | kdeui/klistbox.h \ | 64 | kdeui/klistbox.h \ |
65 | kdeui/klistview.h \ | 65 | kdeui/klistview.h \ |
66 | kdeui/kjanuswidget.h \ | 66 | kdeui/kjanuswidget.h \ |
67 | kdeui/kseparator.h \ | 67 | kdeui/kseparator.h \ |
68 | kdeui/knuminput.h \ | 68 | kdeui/knuminput.h \ |
69 | kdeui/knumvalidator.h \ | 69 | kdeui/knumvalidator.h \ |
70 | kdeui/ksqueezedtextlabel.h \ | 70 | kdeui/ksqueezedtextlabel.h \ |
71 | kio/job.h \ | 71 | kio/job.h \ |
72 | kio/kio/kdirwatch.h \ | 72 | kio/kio/kdirwatch.h \ |
73 | kio/kio/kdirwatch_p.h \ | 73 | kio/kio/kdirwatch_p.h \ |
74 | kio/kfile/kurlrequester.h \ | 74 | kio/kfile/kurlrequester.h \ |
75 | kresources/resource.h \ | 75 | kresources/resource.h \ |
76 | kresources/factory.h \ | 76 | kresources/factory.h \ |
77 | kresources/managerimpl.h \ | 77 | kresources/managerimpl.h \ |
78 | kresources/manager.h \ | 78 | kresources/manager.h \ |
79 | kresources/selectdialog.h \ | 79 | kresources/selectdialog.h \ |
80 | kresources/configpage.h \ | 80 | kresources/configpage.h \ |
81 | kresources/configwidget.h \ | 81 | kresources/configwidget.h \ |
82 | kresources/configdialog.h \ | 82 | kresources/configdialog.h \ |
83 | kresources/kcmkresources.h \ | 83 | kresources/kcmkresources.h \ |
84 | kresources/syncwidget.h \ | ||
85 | kdecore/kmdcodec.h \ | 84 | kdecore/kmdcodec.h \ |
86 | kdecore/kconfigbase.h \ | 85 | kdecore/kconfigbase.h \ |
87 | kdecore/klocale.h \ | 86 | kdecore/klocale.h \ |
88 | kdecore/kcatalogue.h \ | 87 | kdecore/kcatalogue.h \ |
89 | kdecore/ksharedptr.h \ | 88 | kdecore/ksharedptr.h \ |
90 | kdecore/kshell.h \ | 89 | kdecore/kshell.h \ |
91 | kdecore/kstandarddirs.h \ | 90 | kdecore/kstandarddirs.h \ |
92 | kdecore/kstringhandler.h \ | 91 | kdecore/kstringhandler.h \ |
93 | kdecore/kshortcut.h \ | 92 | kdecore/kshortcut.h \ |
94 | kutils/kcmultidialog.h \ | 93 | kutils/kcmultidialog.h \ |
95 | kdeui/kxmlguiclient.h \ | 94 | kdeui/kxmlguiclient.h \ |
96 | kdeui/kstdaction.h \ | 95 | kdeui/kstdaction.h \ |
97 | kdeui/kmainwindow.h \ | 96 | kdeui/kmainwindow.h \ |
98 | kdeui/ktoolbar.h \ | 97 | kdeui/ktoolbar.h \ |
99 | kdeui/ktoolbarbutton.h \ | 98 | kdeui/ktoolbarbutton.h \ |
100 | kdeui/ktoolbarhandler.h \ | 99 | kdeui/ktoolbarhandler.h \ |
101 | kdeui/kaction.h \ | 100 | kdeui/kaction.h \ |
102 | kdeui/kactionclasses.h \ | 101 | kdeui/kactionclasses.h \ |
103 | kdeui/kactioncollection.h \ | 102 | kdeui/kactioncollection.h \ |
104 | kdecore/kprefs.h \ | 103 | kdecore/kprefs.h \ |
105 | kdecore/klibloader.h \ | 104 | kdecore/klibloader.h \ |
106 | kidmanager.h | 105 | kidmanager.h |
107 | 106 | ||
108 | 107 | ||
109 | # kdecore/klibloader.h \ | 108 | # kdecore/klibloader.h \ |
110 | 109 | ||
111 | 110 | ||
112 | SOURCES = \ | 111 | SOURCES = \ |
113 | KDGanttMinimizeSplitter.cpp \ | 112 | KDGanttMinimizeSplitter.cpp \ |
114 | kapplication.cpp \ | 113 | kapplication.cpp \ |
115 | kcalendarsystem.cpp \ | 114 | kcalendarsystem.cpp \ |
116 | kcalendarsystemgregorian.cpp \ | 115 | kcalendarsystemgregorian.cpp \ |
@@ -131,46 +130,45 @@ KDGanttMinimizeSplitter.cpp \ | |||
131 | ktextedit.cpp \ | 130 | ktextedit.cpp \ |
132 | kprocess.cpp \ | 131 | kprocess.cpp \ |
133 | krun.cpp \ | 132 | krun.cpp \ |
134 | ksystemtray.cpp \ | 133 | ksystemtray.cpp \ |
135 | ktempfile.cpp \ | 134 | ktempfile.cpp \ |
136 | kurl.cpp \ | 135 | kurl.cpp \ |
137 | kdecore/kcatalogue.cpp \ | 136 | kdecore/kcatalogue.cpp \ |
138 | kdecore/klocale.cpp \ | 137 | kdecore/klocale.cpp \ |
139 | kdecore/kmdcodec.cpp \ | 138 | kdecore/kmdcodec.cpp \ |
140 | kdecore/kshell.cpp \ | 139 | kdecore/kshell.cpp \ |
141 | kdecore/kstandarddirs.cpp \ | 140 | kdecore/kstandarddirs.cpp \ |
142 | kdecore/kstringhandler.cpp \ | 141 | kdecore/kstringhandler.cpp \ |
143 | kdeui/kbuttonbox.cpp \ | 142 | kdeui/kbuttonbox.cpp \ |
144 | kdeui/kcmodule.cpp \ | 143 | kdeui/kcmodule.cpp \ |
145 | kdeui/kguiitem.cpp \ | 144 | kdeui/kguiitem.cpp \ |
146 | kdeui/kjanuswidget.cpp \ | 145 | kdeui/kjanuswidget.cpp \ |
147 | kdeui/klistbox.cpp \ | 146 | kdeui/klistbox.cpp \ |
148 | kdeui/klistview.cpp \ | 147 | kdeui/klistview.cpp \ |
149 | kdeui/knuminput.cpp \ | 148 | kdeui/knuminput.cpp \ |
150 | kdeui/knumvalidator.cpp \ | 149 | kdeui/knumvalidator.cpp \ |
151 | kdeui/kseparator.cpp \ | 150 | kdeui/kseparator.cpp \ |
152 | kdeui/ksqueezedtextlabel.cpp \ | 151 | kdeui/ksqueezedtextlabel.cpp \ |
153 | kio/kio/kdirwatch.cpp \ | 152 | kio/kio/kdirwatch.cpp \ |
154 | kio/kfile/kurlrequester.cpp \ | 153 | kio/kfile/kurlrequester.cpp \ |
155 | kresources/configpage.cpp \ | 154 | kresources/configpage.cpp \ |
156 | kresources/configdialog.cpp \ | 155 | kresources/configdialog.cpp \ |
157 | kresources/configwidget.cpp \ | 156 | kresources/configwidget.cpp \ |
158 | kresources/factory.cpp \ | 157 | kresources/factory.cpp \ |
159 | kresources/kcmkresources.cpp \ | 158 | kresources/kcmkresources.cpp \ |
160 | kresources/managerimpl.cpp \ | 159 | kresources/managerimpl.cpp \ |
161 | kresources/resource.cpp \ | 160 | kresources/resource.cpp \ |
162 | kresources/selectdialog.cpp \ | 161 | kresources/selectdialog.cpp \ |
163 | kresources/syncwidget.cpp \ | ||
164 | kutils/kcmultidialog.cpp \ | 162 | kutils/kcmultidialog.cpp \ |
165 | kdeui/kaction.cpp \ | 163 | kdeui/kaction.cpp \ |
166 | kdeui/kactionclasses.cpp \ | 164 | kdeui/kactionclasses.cpp \ |
167 | kdeui/kactioncollection.cpp \ | 165 | kdeui/kactioncollection.cpp \ |
168 | kdeui/kmainwindow.cpp \ | 166 | kdeui/kmainwindow.cpp \ |
169 | kdeui/ktoolbar.cpp \ | 167 | kdeui/ktoolbar.cpp \ |
170 | kdeui/ktoolbarbutton.cpp \ | 168 | kdeui/ktoolbarbutton.cpp \ |
171 | kdeui/ktoolbarhandler.cpp \ | 169 | kdeui/ktoolbarhandler.cpp \ |
172 | kdeui/kstdaction.cpp \ | 170 | kdeui/kstdaction.cpp \ |
173 | kdeui/kxmlguiclient.cpp \ | 171 | kdeui/kxmlguiclient.cpp \ |
174 | kdecore/kprefs.cpp \ | 172 | kdecore/kprefs.cpp \ |
175 | kdecore/klibloader.cpp \ | 173 | kdecore/klibloader.cpp \ |
176 | kidmanager.cpp | 174 | kidmanager.cpp |
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 | |||
@@ -1,54 +1,56 @@ | |||
1 | #include <qcombobox.h> | 1 | #include <qcombobox.h> |
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | #include <qhbox.h> | 3 | #include <qhbox.h> |
4 | #include <qheader.h> | 4 | #include <qheader.h> |
5 | #include <qlabel.h> | 5 | #include <qlabel.h> |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | #include <qlineedit.h> | 7 | #include <qlineedit.h> |
8 | #include <qlistview.h> | 8 | #include <qlistview.h> |
9 | #include <qpopupmenu.h> | 9 | #include <qpopupmenu.h> |
10 | #include <qwidgetstack.h> | 10 | #include <qwidgetstack.h> |
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{ |
35 | return m_name; | 37 | return m_name; |
36 | } | 38 | } |
37 | void OFileViewInterface::setName( const QString& name ) { | 39 | void OFileViewInterface::setName( const QString& name ) { |
38 | m_name = name; | 40 | m_name = name; |
39 | } | 41 | } |
40 | OFileSelector* OFileViewInterface::selector()const { | 42 | OFileSelector* OFileViewInterface::selector()const { |
41 | return m_selector; | 43 | return m_selector; |
42 | } | 44 | } |
43 | 45 | ||
44 | DocLnk OFileViewInterface::selectedDocument()const { | 46 | DocLnk OFileViewInterface::selectedDocument()const { |
45 | return DocLnk( selectedName() ); | 47 | return DocLnk( selectedName() ); |
46 | } | 48 | } |
47 | 49 | ||
48 | bool OFileViewInterface::showNew()const { | 50 | bool OFileViewInterface::showNew()const { |
49 | return selector()->showNew(); | 51 | return selector()->showNew(); |
50 | } | 52 | } |
51 | bool OFileViewInterface::showClose()const { | 53 | bool OFileViewInterface::showClose()const { |
52 | return selector()->showClose(); | 54 | return selector()->showClose(); |
53 | } | 55 | } |
54 | MimeTypes OFileViewInterface::mimeTypes()const { | 56 | MimeTypes OFileViewInterface::mimeTypes()const { |
@@ -438,85 +440,86 @@ void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const | |||
438 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); | 440 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); |
439 | emit selector()->fileSelected( path ); | 441 | emit selector()->fileSelected( path ); |
440 | DocLnk lnk( path ); | 442 | DocLnk lnk( path ); |
441 | emit selector()->fileSelected( lnk ); | 443 | emit selector()->fileSelected( lnk ); |
442 | } | 444 | } |
443 | } // not locked | 445 | } // not locked |
444 | } | 446 | } |
445 | void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { | 447 | void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { |
446 | MimeType type( info->absFilePath() ); | 448 | MimeType type( info->absFilePath() ); |
447 | if (!compliesMime( type.id() ) ) | 449 | if (!compliesMime( type.id() ) ) |
448 | return; | 450 | return; |
449 | 451 | ||
450 | QPixmap pix = type.pixmap(); | 452 | QPixmap pix = type.pixmap(); |
451 | QString dir, name; bool locked; | 453 | QString dir, name; bool locked; |
452 | if ( pix.isNull() ) { | 454 | if ( pix.isNull() ) { |
453 | QWMatrix matrix; | 455 | QWMatrix matrix; |
454 | QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); | 456 | QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); |
455 | matrix.scale( .4, .4 ); | 457 | matrix.scale( .4, .4 ); |
456 | pix = pixer.xForm( matrix ); | 458 | pix = pixer.xForm( matrix ); |
457 | } | 459 | } |
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 | ||
503 | if (!dir.exists() ) | 506 | if (!dir.exists() ) |
504 | m_currentDir = "/"; | 507 | m_currentDir = "/"; |
505 | else | 508 | else |
506 | m_currentDir = dir.absPath(); | 509 | m_currentDir = dir.absPath(); |
507 | 510 | ||
508 | emit selector()->dirSelected( m_currentDir ); | 511 | emit selector()->dirSelected( m_currentDir ); |
509 | reread( m_all ); | 512 | reread( m_all ); |
510 | } | 513 | } |
511 | void OFileViewFileListView::cdHome() { | 514 | void OFileViewFileListView::cdHome() { |
512 | m_currentDir = QDir::homeDirPath(); | 515 | m_currentDir = QDir::homeDirPath(); |
513 | emit selector()->dirSelected( m_currentDir ); | 516 | emit selector()->dirSelected( m_currentDir ); |
514 | reread( m_all ); | 517 | reread( m_all ); |
515 | } | 518 | } |
516 | void OFileViewFileListView::cdDoc() { | 519 | void OFileViewFileListView::cdDoc() { |
517 | m_currentDir = QPEApplication::documentDir(); | 520 | m_currentDir = QPEApplication::documentDir(); |
518 | emit selector()->dirSelected( m_currentDir ); | 521 | emit selector()->dirSelected( m_currentDir ); |
519 | reread( m_all ); | 522 | reread( m_all ); |
520 | } | 523 | } |
521 | void OFileViewFileListView::changeDir( const QString& dir ) { | 524 | void OFileViewFileListView::changeDir( const QString& dir ) { |
522 | m_currentDir = dir; | 525 | m_currentDir = dir; |