summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/libopie.pro4
-rw-r--r--libopie/ofiledialog.cc12
-rw-r--r--libopie/ofileselector.cc34
3 files changed, 16 insertions, 34 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro
index 4ba2836..3c8da78 100644
--- a/libopie/libopie.pro
+++ b/libopie/libopie.pro
@@ -1,7 +1,7 @@
TEMPLATE = lib
CONFIG += qte warn_on release
-HEADERS = ofileselector.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h oconfig.h
-SOURCES = ofileselector.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp oconfig.cpp
+HEADERS = ofileselector.h ofiledialog.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h oconfig.h
+SOURCES = ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp oconfig.cpp
TARGET = opie
INCLUDEPATH += $(OPIEDIR)/include
DESTDIR = $(QTDIR)/lib$(PROJMAK)
diff --git a/libopie/ofiledialog.cc b/libopie/ofiledialog.cc
index 92b0d0a..164fadd 100644
--- a/libopie/ofiledialog.cc
+++ b/libopie/ofiledialog.cc
@@ -40,12 +40,15 @@ OFileDialog::OFileDialog(const QString &caption,
const QStringList &mimetypes )
: QDialog( wid, "OFileDialog", true )
{
+ // QVBoxLayout *lay = new QVBoxLayout(this);
+ //showMaximized();
QVBoxLayout *lay = new QVBoxLayout(this);
-
- file = new OFileSelector(0 , mode, selector,
+ file = new OFileSelector(this , mode, selector,
dirName, fileName,
mimetypes );
lay->addWidget( file );
+
+ //lay->addWidget( file );
//showFullScreen();
setCaption( caption.isEmpty() ? tr("FileDialog") : caption );
connect(file, SIGNAL(fileSelected(const QString&) ),
@@ -53,7 +56,8 @@ OFileDialog::OFileDialog(const QString &caption,
connect(file, SIGNAL(dirSelected(const QString &) ),
this, SLOT(slotDirSelected(const QString &) ) );
- showMaximized();
+
+
file->setYesCancelVisible( false ); // relayout
}
QString OFileDialog::mimetype()const
@@ -78,6 +82,7 @@ QString OFileDialog::getOpenFileName(int selector,
QString ret;
OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption,
wid, OFileSelector::OPEN, selector, startDir, file, mimes);
+ dlg.showMaximized();
if( dlg.exec() )
ret = dlg.fileName();
@@ -93,6 +98,7 @@ QString OFileDialog::getSaveFileName(int selector,
QString ret;
OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption,
wid, OFileSelector::SAVE, selector, startDir, file, mimes);
+ dlg.showMaximized();
if( dlg.exec() )
ret = dlg.fileName();
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index c3a3514..7451c1b 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -79,7 +79,7 @@ namespace {
OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName,
const QString &fileName, const QStringList &mimetypes ) : QWidget( wid )
{
-
+ if(wid!=0)
resize(wid->width(),wid->height());
m_selector = selector;
m_currentDir = dirName;
@@ -194,6 +194,7 @@ void OFileSelector::init()
m_lay->addWidget(m_stack );
m_stack->raiseWidget(NORMAL );
connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) );
+ m_pseudoLayout = 0l;
}else {
initializeListView();
}
@@ -595,6 +596,7 @@ void OFileSelector::slotViewCheck(const QString &view ){
delete m_location;
delete m_up;
delete m_pseudo;
+ if(m_pseudoLayout!=0 )
delete m_pseudoLayout;
}
m_View = 0;
@@ -624,20 +626,7 @@ void OFileSelector::slotViewCheck(const QString &view ){
delete m_View;
m_View = 0;
- delete m_boxToolbar;
- delete m_homeButton;
- delete m_docButton;
- delete m_location;
- delete m_up;
- delete m_pseudo;
- delete m_pseudoLayout;
- m_boxToolbar = 0;
- m_homeButton = 0;
- m_docButton = 0;
- m_location = 0;
- m_up = 0;
- m_pseudo = 0;
- m_pseudoLayout = 0;
+
m_selector = EXTENDED;
// create the ListView or IconView
@@ -650,20 +639,6 @@ void OFileSelector::slotViewCheck(const QString &view ){
m_select = 0;
delete m_View;
m_View = 0;
- delete m_boxToolbar;
- delete m_homeButton;
- delete m_docButton;
- delete m_location;
- delete m_up;
- delete m_pseudo;
- delete m_pseudoLayout;
- m_boxToolbar = 0;
- m_homeButton = 0;
- m_docButton = 0;
- m_location = 0;
- m_up = 0;
- m_pseudo = 0;
- m_pseudoLayout = 0;
m_selector = EXTENDED_ALL;
initializeListView();
@@ -701,6 +676,7 @@ void OFileSelector::initializeListView()
delete m_location;
delete m_up;
delete m_pseudo;
+ if(m_pseudoLayout!=0 ) // why did you overload malloc
delete m_pseudoLayout;
m_boxToolbar = 0;
m_homeButton = 0;