author | zautrix <zautrix> | 2005-06-18 18:03:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-18 18:03:50 (UTC) |
commit | 3d86c369e8b48b340e4093b034f1347defea876b (patch) (side-by-side diff) | |
tree | 50becb886d75770ce35108f4f97837b6b9d5664f /microkde | |
parent | 45c93de5a458e7ca0c293eebe504a9d949cc045c (diff) | |
download | kdepimpi-3d86c369e8b48b340e4093b034f1347defea876b.zip kdepimpi-3d86c369e8b48b340e4093b034f1347defea876b.tar.gz kdepimpi-3d86c369e8b48b340e4093b034f1347defea876b.tar.bz2 |
file dialog fixes
-rw-r--r-- | microkde/ofileselector_p.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp index e2af32b..488dee2 100644 --- a/microkde/ofileselector_p.cpp +++ b/microkde/ofileselector_p.cpp @@ -136,58 +136,59 @@ QWidget* ODocumentFileView::widget( QWidget* parent ) { m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() ); QObject::connect(m_selector, SIGNAL(fileSelected( const DocLnk& ) ), selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) ); QObject::connect(m_selector, SIGNAL(closeMe() ), selector(), SIGNAL(closeMe() ) ); QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk& ) ), selector(), SIGNAL(newSelected(const DocLnk& ) ) ); } return m_selector; } /* * This is the file system view used * we use a QListView + QListViewItems for it */ OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, const QString& path, const QString& date, const QString& size, const QString& dir, bool isLocked, bool isDir ) : QListViewItem( view ) { - QString kind; + QString kind = "dir";; QString _path = path; - if ( isDir ) - kind = "dir"; - else - kind = "file"; + if ( !isDir ){ + int arrow = path.findRev( "." ,-1); + if (arrow > 0 ) { + kind = path.mid(arrow+1); + } + } setPixmap(0, pixmap ); 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; } OFileSelectorItem::~OFileSelectorItem() { } bool OFileSelectorItem::isLocked()const { return m_locked; } QString OFileSelectorItem::directory()const { return m_dir; } bool OFileSelectorItem::isDir()const { return m_isDir; } QString OFileSelectorItem::path()const { return text( 1 ); @@ -270,51 +271,51 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st StorageInfo storage; const QList<FileSystem> &fs = storage.fileSystems(); QListIterator<FileSystem> it(fs); for ( ; it.current(); ++it ) { const QString disk = (*it)->name(); const QString path = (*it)->path(); m_dev.insert( disk, path ); pop->insertItem( disk ); } m_fsPop = pop; btn->setPopup( pop ); btn->setPopupDelay ( 0 ); lay->addWidget( box ); m_view = new QListView( this ); m_view->installEventFilter(this); QPEApplication::setStylusOperation( m_view->viewport(), QPEApplication::RightOnHold); m_view->addColumn(" " ); - m_view->addColumn(i18n("Name"), 135 ); + m_view->addColumn(i18n("Name"), 150 ); m_view->addColumn(i18n("Size"), -1 ); - m_view->addColumn(i18n("Date"), 60 ); + m_view->addColumn(i18n("Date"), -1 ); m_view->addColumn(i18n("Mime Type"), -1 ); m_view->setSorting( 1 ); m_view->setAllColumnsShowFocus( TRUE ); lay->addWidget( m_view, 1000 ); connectSlots(); } OFileViewFileListView::~OFileViewFileListView() { } void OFileViewFileListView::slotNew() { DocLnk lnk; emit selector()->newSelected( lnk ); } OFileSelectorItem* OFileViewFileListView::currentItem()const{ QListViewItem* item = m_view->currentItem(); if (!item ) return 0l; return static_cast<OFileSelectorItem*>(item); } void OFileViewFileListView::reread( bool all ) { m_view->clear(); |