summaryrefslogtreecommitdiff
path: root/libopie2
authoralwin <alwin>2005-03-24 13:28:49 (UTC)
committer alwin <alwin>2005-03-24 13:28:49 (UTC)
commit29da9a4477210843435cbea3ede0d520775fe1a5 (patch) (side-by-side diff)
tree487b26273bcdb8e29cd3f591955e8469d01c0da7 /libopie2
parent4fbd94e2fd6432bb15e24e40be59426b309cbb9d (diff)
downloadopie-29da9a4477210843435cbea3ede0d520775fe1a5.zip
opie-29da9a4477210843435cbea3ede0d520775fe1a5.tar.gz
opie-29da9a4477210843435cbea3ede0d520775fe1a5.tar.bz2
the filesystem-menu will executed when click on the filsystem-button
not when hold the pen on it.
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp18
-rw-r--r--libopie2/opieui/fileselector/ofileselector_p.h2
2 files changed, 14 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
@@ -67,8 +67,8 @@ namespace Internal {
* 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;
}
@@ -288,7 +288,7 @@ QString OFileSelectorItem::path()const
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
@@ -307,7 +307,7 @@ QString OFileSelectorItem::key( int id, bool )const
}
return ke;
}else if(id == 2) {
- return text(2).rightJustify(20, '0');
+ return text(2).rightJustify(20, '0');
}else
return text( id );
@@ -363,6 +363,7 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
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) ),
@@ -380,8 +381,7 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
}
m_fsPop = pop;
-
- btn->setPopup( pop );
+ connect(btn,SIGNAL(pressed()),this,SLOT(slotFSpressed()));
lay->addWidget( box );
@@ -405,6 +405,12 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
connectSlots();
}
+void OFileViewFileListView::slotFSpressed()
+{
+ m_fsPop->exec(QPoint( QCursor::pos().x(), QCursor::pos().y()));
+ m_fsButton->setDown(false);
+}
+
OFileViewFileListView::~OFileViewFileListView()
{
}
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h
index 15db916..94216a0 100644
--- a/libopie2/opieui/fileselector/ofileselector_p.h
+++ b/libopie2/opieui/fileselector/ofileselector_p.h
@@ -164,6 +164,7 @@ private slots:
void slotCurrentChanged( QListViewItem* );
void slotClicked(int, QListViewItem*, const QPoint&, int );
void slotFSActivated(int);
+ void slotFSpressed();
protected:
OFileSelector* selector();
@@ -177,6 +178,7 @@ private:
QStringList m_mimes; // used in compy mime
QString m_currentDir;
QToolButton *m_btnNew, *m_btnClose;
+ QToolButton *m_fsButton;
void connectSlots();
void addFile( QFileInfo* info, bool symlink = FALSE );
void addDir ( QFileInfo* info, bool symlink = FALSE );