author | zecke <zecke> | 2002-10-28 19:55:18 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-28 19:55:18 (UTC) |
commit | 3ba494eb02e72e1f9a732c46ec8085e843f01eca (patch) (side-by-side diff) | |
tree | cdc0e7af342cd0e205ed4ae1c1da92ced3fd5774 /libopie/ofileselector/olister.cpp | |
parent | e9d8023028b7c996d8ff2a68b87dfde19fcfa892 (diff) | |
download | opie-3ba494eb02e72e1f9a732c46ec8085e843f01eca.zip opie-3ba494eb02e72e1f9a732c46ec8085e843f01eca.tar.gz opie-3ba494eb02e72e1f9a732c46ec8085e843f01eca.tar.bz2 |
This will probably not compile.. i did not even try to compile it
on my machine
I changed the data flow to be more extandable the Olister class
is now playing a bigger role it's dependant on
doing some assembly of the filepath and changedirs.
It now has also to take care of the location bar
Diffstat (limited to 'libopie/ofileselector/olister.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/ofileselector/olister.cpp | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/libopie/ofileselector/olister.cpp b/libopie/ofileselector/olister.cpp index b6b03cd..378c69d 100644 --- a/libopie/ofileselector/olister.cpp +++ b/libopie/ofileselector/olister.cpp @@ -1 +1,3 @@ +#include <qcombobox.h> + #include "olister.h" @@ -7,3 +9,3 @@ OLister::OLister( OFileSelector* view) - : m_view( view ) + : m_view( view ), m_acc( 0l ) { @@ -26,2 +28,3 @@ void OLister::addFile( const QString& mine, QFileInfo* info, + const QString& extra, bool isSymlink ) { @@ -34,2 +37,3 @@ void OLister::addFile( const QString& mine, info, + extra, isSymlink ); @@ -39,2 +43,3 @@ void OLister::addFile( const QString& mine, const QString& file, + const QString& extra, bool isSymlink ) { @@ -48,2 +53,3 @@ void OLister::addFile( const QString& mine, file, + extra, isSymlink ); @@ -52,2 +58,3 @@ void OLister::addDir( const QString& mine, QFileInfo* info, + const QString& extra, bool isSymlink ) { @@ -59,2 +66,3 @@ void OLister::addDir( const QString& mine, info, + extra, isSymlink ); @@ -64,2 +72,3 @@ void OLister::addDir( const QString& mine, const QString& dir, + const QString& extra, bool isSymlink ) { @@ -74,2 +83,3 @@ void OLister::addDir( const QString& mine, dir, + extra, isSymlink ); @@ -78,2 +88,3 @@ void OLister::addSymlink( const QString& mine, QFileInfo* info, + const QString& extra, bool isSymlink ) { @@ -83,2 +94,3 @@ void OLister::addSymlink( const QString& mine, info, + extra, isSymlink ); @@ -88,2 +100,3 @@ void OLister::addSymlink( const QString& mine, const QString& name, + const QString& extra, bool isSymlink ) { @@ -95,2 +108,3 @@ void OLister::addSymlink( const QString& mine, name, + extra, isSymlink ); @@ -106 +120,43 @@ bool OLister::compliesMime( const QString& mime ) { } +OListerCmbAccess* OLister::comboBox() { + if (!m_acc ) + m_acc = new OListerCmbAccess( view()->m_location ); + + return m_acc; +} + + +OListerCmbAccess::OListerCmbAccess(QComboBox* box ) + : m_cmb( cmb ) +{} +OListerCmbAccess::~OListerCmbAccess() { +} +void OListerCmbAccess::clear() { + if ( m_cmb ) + m_cmb->clear(); +} +void OListerCmbAccess::setCurrentItem( const QString& add, bool FORCE_ADD) { + if ( !m_cmb ) return; + + + int c = m_cmb->count(); + for ( int i = 0; i < m_cmb->count(); i++ ) { + if ( m_cmb->text(i) == add ) { + bo->setCurrentItem( i ); + return; + } + } + m_cmb->insertItem(add ); + m_cmb->setCurrentItem( c ); +} +void OListerCmbAccess::insert( const QString& str ) { + if ( m_cmb ) + m_cmb->insertItem( str ); +} +QString OListerCmbAccess::currentText()const { + QString str; + if (m_cmb ) + str = m_cmb->currentText(); + + return str; +} |