summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index 74aca96..dbba4b9 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -64,14 +64,14 @@ namespace Ui {
namespace Internal {
/*
* Create a path by adding a '/'/QDir::seperator in between
* base and ending, but only if base is not empty
*/
static inline QString createNewPath(const QString& base, const QString &ending) {
- return base == QString::fromLatin1("/") ?
- base + ending : base + "/" + ending;
+ return base == QString::fromLatin1("/") ?
+ base + ending : base + "/" + ending;
}
OFileViewInterface::OFileViewInterface( OFileSelector* _selector )
: m_selector( _selector )
{
@@ -285,13 +285,13 @@ QString OFileSelectorItem::path()const
return text( 1 );
}
QString OFileSelectorItem::key( int id, bool )const
{
QString ke;
-
+
/*
* id = 0 ||id == 1 : Sort By Name but Directories at Top
* id = 2 : Sort By Size: Prepend '0' to the key
*/
if( id == 0 || id == 1 )
{ // name
@@ -304,13 +304,13 @@ QString OFileSelectorItem::key( int id, bool )const
{
ke.append("1" );
ke.append( text(1) );
}
return ke;
}else if(id == 2) {
- return text(2).rightJustify(20, '0');
+ return text(2).rightJustify(20, '0');
}else
return text( id );
}
OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, OFileSelector* sel)
@@ -360,12 +360,13 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
connect(m_btnClose, SIGNAL(clicked() ),
selector(), SIGNAL(closeMe() ) );
btn = new QToolButton( box );
btn->setIconSet( Resource::loadIconSet("cardmon/pcmcia") );
+ m_fsButton = btn;
/* let's fill device parts */
QPopupMenu* pop = new QPopupMenu(this);
connect(pop, SIGNAL( activated(int) ),
this, SLOT(slotFSActivated(int) ) );
StorageInfo storage;
@@ -377,14 +378,13 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
const QString path = (*it)->path();
m_dev.insert( disk, path );
pop->insertItem( disk );
}
m_fsPop = pop;
-
- btn->setPopup( pop );
+ connect(btn,SIGNAL(pressed()),this,SLOT(slotFSpressed()));
lay->addWidget( box );
m_view = new QListView( this );
m_view->installEventFilter(this);
@@ -402,12 +402,18 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
m_view->setAllColumnsShowFocus( TRUE );
lay->addWidget( m_view, 1000 );
connectSlots();
}
+void OFileViewFileListView::slotFSpressed()
+{
+ m_fsPop->exec(QPoint( QCursor::pos().x(), QCursor::pos().y()));
+ m_fsButton->setDown(false);
+}
+
OFileViewFileListView::~OFileViewFileListView()
{
}
void OFileViewFileListView::slotNew()
{