-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 @@ -36,141 +36,139 @@ KDGanttMinimizeSplitter.h \ kdebug.h \ kdialog.h \ kdialogbase.h \ keditlistbox.h \ kemailsettings.h \ kfiledialog.h \ kfontdialog.h \ kglobal.h \ kglobalsettings.h \ kiconloader.h \ klineedit.h \ klineeditdlg.h \ kmessagebox.h \ knotifyclient.h \ kprinter.h \ kprocess.h \ krestrictedline.h \ krun.h \ ksimpleconfig.h \ kstaticdeleter.h \ ksystemtray.h \ ktempfile.h \ ktextedit.h \ kunload.h \ kurl.h \ kdeui/kguiitem.h \ kdeui/kcmodule.h \ kdeui/kbuttonbox.h \ kdeui/klistbox.h \ kdeui/klistview.h \ kdeui/kjanuswidget.h \ kdeui/kseparator.h \ kdeui/knuminput.h \ kdeui/knumvalidator.h \ kdeui/ksqueezedtextlabel.h \ kio/job.h \ kio/kio/kdirwatch.h \ kio/kio/kdirwatch_p.h \ kio/kfile/kurlrequester.h \ kresources/resource.h \ kresources/factory.h \ kresources/managerimpl.h \ kresources/manager.h \ kresources/selectdialog.h \ kresources/configpage.h \ kresources/configwidget.h \ kresources/configdialog.h \ kresources/kcmkresources.h \ - kresources/syncwidget.h \ kdecore/kmdcodec.h \ kdecore/kconfigbase.h \ kdecore/klocale.h \ kdecore/kcatalogue.h \ kdecore/ksharedptr.h \ kdecore/kshell.h \ kdecore/kstandarddirs.h \ kdecore/kstringhandler.h \ kdecore/kshortcut.h \ kutils/kcmultidialog.h \ kdeui/kxmlguiclient.h \ kdeui/kstdaction.h \ kdeui/kmainwindow.h \ kdeui/ktoolbar.h \ kdeui/ktoolbarbutton.h \ kdeui/ktoolbarhandler.h \ kdeui/kaction.h \ kdeui/kactionclasses.h \ kdeui/kactioncollection.h \ kdecore/kprefs.h \ kdecore/klibloader.h \ kidmanager.h # kdecore/klibloader.h \ SOURCES = \ KDGanttMinimizeSplitter.cpp \ kapplication.cpp \ kcalendarsystem.cpp \ kcalendarsystemgregorian.cpp \ kcolorbutton.cpp \ kcolordialog.cpp \ kconfig.cpp \ kdatetbl.cpp \ kdialog.cpp \ kdialogbase.cpp \ keditlistbox.cpp \ kemailsettings.cpp \ kfontdialog.cpp \ kfiledialog.cpp \ kglobal.cpp \ kglobalsettings.cpp \ kiconloader.cpp \ kmessagebox.cpp \ ktextedit.cpp \ kprocess.cpp \ krun.cpp \ ksystemtray.cpp \ ktempfile.cpp \ kurl.cpp \ kdecore/kcatalogue.cpp \ kdecore/klocale.cpp \ kdecore/kmdcodec.cpp \ kdecore/kshell.cpp \ kdecore/kstandarddirs.cpp \ kdecore/kstringhandler.cpp \ kdeui/kbuttonbox.cpp \ kdeui/kcmodule.cpp \ kdeui/kguiitem.cpp \ kdeui/kjanuswidget.cpp \ kdeui/klistbox.cpp \ kdeui/klistview.cpp \ kdeui/knuminput.cpp \ kdeui/knumvalidator.cpp \ kdeui/kseparator.cpp \ kdeui/ksqueezedtextlabel.cpp \ kio/kio/kdirwatch.cpp \ kio/kfile/kurlrequester.cpp \ kresources/configpage.cpp \ kresources/configdialog.cpp \ kresources/configwidget.cpp \ kresources/factory.cpp \ kresources/kcmkresources.cpp \ kresources/managerimpl.cpp \ kresources/resource.cpp \ kresources/selectdialog.cpp \ - kresources/syncwidget.cpp \ kutils/kcmultidialog.cpp \ kdeui/kaction.cpp \ kdeui/kactionclasses.cpp \ kdeui/kactioncollection.cpp \ kdeui/kmainwindow.cpp \ kdeui/ktoolbar.cpp \ kdeui/ktoolbarbutton.cpp \ kdeui/ktoolbarhandler.cpp \ kdeui/kstdaction.cpp \ kdeui/kxmlguiclient.cpp \ kdecore/kprefs.cpp \ kdecore/klibloader.cpp \ 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,70 +1,72 @@ #include <qcombobox.h> #include <qdir.h> #include <qhbox.h> #include <qheader.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qlistview.h> #include <qpopupmenu.h> #include <qwidgetstack.h> #include <qregexp.h> #include <qobjectlist.h> /* hacky but we need to get FileSelector::filter */ #define private public #include <qpe/fileselector.h> #undef private #include <qpe/qpeapplication.h> #include <qpe/mimetype.h> #include <qpe/resource.h> #include <qpe/storage.h> +#include <kglobal.h> +#include <klocale.h> #include "ofileselector_p.h" //US#include "ofileselector.h" #include "klocale.h" OFileViewInterface::OFileViewInterface( OFileSelector* selector ) : m_selector( selector ) { } OFileViewInterface::~OFileViewInterface() { } QString OFileViewInterface::name()const{ return m_name; } void OFileViewInterface::setName( const QString& name ) { m_name = name; } OFileSelector* OFileViewInterface::selector()const { return m_selector; } DocLnk OFileViewInterface::selectedDocument()const { return DocLnk( selectedName() ); } bool OFileViewInterface::showNew()const { return selector()->showNew(); } bool OFileViewInterface::showClose()const { return selector()->showClose(); } MimeTypes OFileViewInterface::mimeTypes()const { return selector()->mimeTypes(); } QStringList OFileViewInterface::currentMimeType()const { return selector()->currentMimeType(); } void OFileViewInterface::activate( const QString& ) { // not implemented here } void OFileViewInterface::ok() { emit selector()->ok(); } void OFileViewInterface::cancel() { emit selector()->cancel(); } void OFileViewInterface::closeMe() { emit selector()->closeMe(); @@ -422,117 +424,118 @@ void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) { #endif } void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) { if (!item || ( button != Qt::LeftButton) ) return; OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); if (!sel->isLocked() ) { QStringList str = QStringList::split("->", sel->text(1) ); if (sel->isDir() ) { m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); emit selector()->dirSelected( m_currentDir ); reread( m_all ); }else { // file qWarning("slot Clicked"); selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); emit selector()->fileSelected( path ); DocLnk lnk( path ); emit selector()->fileSelected( lnk ); } } // not locked } void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { MimeType type( info->absFilePath() ); if (!compliesMime( type.id() ) ) return; QPixmap pix = type.pixmap(); QString dir, name; bool locked; if ( pix.isNull() ) { QWMatrix matrix; QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); matrix.scale( .4, .4 ); pix = pixer.xForm( matrix ); } dir = info->dirPath( true ); locked = false; if ( symlink ) name = info->fileName() + " -> " + info->dirPath() + "/" + info->readLink(); else{ name = info->fileName(); if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) { locked = true; pix = Resource::loadPixmap("locked"); } } (void)new OFileSelectorItem( m_view, pix, name, - info->lastModified().toString(), QString::number( info->size() ), + KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate), + QString::number( info->size() ), dir, locked ); } void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) { bool locked = false; QString name; QPixmap pix; if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) { locked = true; if ( symlink ) pix = Resource::loadPixmap( "symlink" ); else pix = Resource::loadPixmap( "lockedfolder" ); }else pix = symlink ? Resource::loadPixmap( "symlink") : Resource::loadPixmap("folder"); name = symlink ? info->fileName() + " -> " + info->dirPath(true) + "/" + info->readLink() : info->fileName(); (void)new OFileSelectorItem( m_view, pix, name, - info->lastModified().toString(), + KGlobal::locale()->formatDateTime(info->lastModified(),true, true, KLocale::ISODate), QString::number( info->size() ), info->dirPath( true ), locked, true ); } void OFileViewFileListView::addSymlink( QFileInfo* , bool ) { } void OFileViewFileListView::cdUP() { QDir dir( m_currentDir ); dir.cdUp(); if (!dir.exists() ) m_currentDir = "/"; else m_currentDir = dir.absPath(); emit selector()->dirSelected( m_currentDir ); reread( m_all ); } void OFileViewFileListView::cdHome() { m_currentDir = QDir::homeDirPath(); emit selector()->dirSelected( m_currentDir ); reread( m_all ); } void OFileViewFileListView::cdDoc() { m_currentDir = QPEApplication::documentDir(); emit selector()->dirSelected( m_currentDir ); reread( m_all ); } void OFileViewFileListView::changeDir( const QString& dir ) { m_currentDir = dir; emit selector()->dirSelected( m_currentDir ); reread( m_all ); } void OFileViewFileListView::slotFSActivated( int id ) { changeDir ( m_dev[m_fsPop->text(id)] ); } /* check if the mimetype in mime * complies with the one which is current */ /* * We've the mimetype of the file * We need to get the stringlist of the current mimetype * * mime = image@slashjpeg * QStringList = 'image@slash*' |