summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.cc
authorzecke <zecke>2002-06-23 14:19:13 (UTC)
committer zecke <zecke>2002-06-23 14:19:13 (UTC)
commitce9178fb13908eca5b7835e785fc0914a5022615 (patch) (side-by-side diff)
treed848ef07fb25ba6c21d3729140c4e3be9d69f6f6 /libopie/ofileselector.cc
parent3b02ead2254e59159db948d2a0980892eeb14ed8 (diff)
downloadopie-ce9178fb13908eca5b7835e785fc0914a5022615.zip
opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.gz
opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.bz2
Simon thanks for the patch. Some clean ups. Patch provided by tronical
OAOAOAOAOAOAOAOAOAOAOAOAOBOBCVS: noncore/tools/remote/dvdgroupconf.cpp
Diffstat (limited to 'libopie/ofileselector.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 8299b3d..7a67ab2 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -68,98 +68,98 @@ namespace {
}
bool isDir()const{
return dir;
}
QString path()const{
return text(1 );
}
QString key(int id, bool )const {
QString ke;
if( id == 0 || id == 1 ){ // name
if( dir ){
ke.append("0" );
ke.append( text(1) );
}else{
ke.append("1" );
ke.append( text(1) );
}
}else if( id == 2 ){ // size
return text(2);
}else if( id == 3 ){ // date
return text(3);
}
return ke;
};
private:
bool mLocked:1;
bool dir:1;
QString m_dir;
};
};
OFileSelector::OFileSelector( QWidget *wid, int mode, int selector,
const QString &dirName,
const QString &fileName,
const QStringList &mimeTypes )
: QWidget( wid, "OFileSelector")
{
m_mimetypes = mimeTypes;
initVars();
m_mode = mode;
m_selector = selector;
m_currentDir = dirName;
init();
QTimer::singleShot(6*1000, this, SLOT( slotTest() ) );
}
OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent,
- const char *name, bool newVisible = TRUE,
- bool closeVisible = FALSE )
+ const char *name, bool newVisible,
+ bool closeVisible )
: QWidget( parent, name )
{
m_mimetypes = QStringList::split(";", mimeFilter );
initVars();
m_currentDir = QPEApplication::documentDir();
m_mode = OPEN;
m_selector = NORMAL;
m_shClose = closeVisible;
m_shNew = newVisible;
m_shLne = false;
m_shPerm = false;
m_shYesNo = false;
init();
}
OFileSelector::~OFileSelector()
{
}
void OFileSelector::setNewVisible( bool visible )
{
m_shNew = visible;
if( m_selector == NORMAL ){
delete m_select;
// we need to initialize but keep the selected mimetype
QString mime = m_mimeCheck == 0 ? QString::null : m_mimeCheck->currentText() ;
m_select = new FileSelector( m_autoMime ? mime : m_mimetypes.join(";") ,
m_stack, "fileselector",
m_shNew, m_shClose);
connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
//connect to close me and other signals as well
m_stack->addWidget( m_select, NORMAL );
}else{
m_new->show();
}
}
void OFileSelector::setCloseVisible( bool visible )
{
m_shClose = visible;
if( m_selector == NORMAL ){
setNewVisible( m_shNew ); // yeah baby
}else{
m_close->show();
}