-rw-r--r-- | libopie/libopie.pro | 4 | ||||
-rw-r--r-- | libopie/ofiledialog.cc | 14 | ||||
-rw-r--r-- | libopie/ofileselector.cc | 40 |
3 files changed, 20 insertions, 38 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro index 4ba2836..3c8da78 100644 --- a/libopie/libopie.pro +++ b/libopie/libopie.pro | |||
@@ -1,8 +1,8 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qte warn_on release | 2 | CONFIG += qte warn_on release |
3 | HEADERS = ofileselector.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h oconfig.h | 3 | HEADERS = ofileselector.h ofiledialog.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h oconfig.h |
4 | SOURCES = ofileselector.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp oconfig.cpp | 4 | SOURCES = ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp oconfig.cpp |
5 | TARGET = opie | 5 | TARGET = opie |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) | 7 | DESTDIR = $(QTDIR)/lib$(PROJMAK) |
8 | #VERSION = 1.0.0 \ No newline at end of file | 8 | #VERSION = 1.0.0 \ No newline at end of file |
diff --git a/libopie/ofiledialog.cc b/libopie/ofiledialog.cc index 92b0d0a..164fadd 100644 --- a/libopie/ofiledialog.cc +++ b/libopie/ofiledialog.cc | |||
@@ -39,22 +39,26 @@ OFileDialog::OFileDialog(const QString &caption, | |||
39 | const QString &fileName, | 39 | const QString &fileName, |
40 | const QStringList &mimetypes ) | 40 | const QStringList &mimetypes ) |
41 | : QDialog( wid, "OFileDialog", true ) | 41 | : QDialog( wid, "OFileDialog", true ) |
42 | { | 42 | { |
43 | QVBoxLayout *lay = new QVBoxLayout(this); | 43 | // QVBoxLayout *lay = new QVBoxLayout(this); |
44 | 44 | //showMaximized(); | |
45 | file = new OFileSelector(0 , mode, selector, | 45 | QVBoxLayout *lay = new QVBoxLayout(this ); |
46 | file = new OFileSelector(this , mode, selector, | ||
46 | dirName, fileName, | 47 | dirName, fileName, |
47 | mimetypes ); | 48 | mimetypes ); |
48 | lay->addWidget( file ); | 49 | lay->addWidget( file ); |
50 | |||
51 | //lay->addWidget( file ); | ||
49 | //showFullScreen(); | 52 | //showFullScreen(); |
50 | setCaption( caption.isEmpty() ? tr("FileDialog") : caption ); | 53 | setCaption( caption.isEmpty() ? tr("FileDialog") : caption ); |
51 | connect(file, SIGNAL(fileSelected(const QString&) ), | 54 | connect(file, SIGNAL(fileSelected(const QString&) ), |
52 | this, SLOT(slotFileSelected(const QString&) ) ); | 55 | this, SLOT(slotFileSelected(const QString&) ) ); |
53 | 56 | ||
54 | connect(file, SIGNAL(dirSelected(const QString &) ), | 57 | connect(file, SIGNAL(dirSelected(const QString &) ), |
55 | this, SLOT(slotDirSelected(const QString &) ) ); | 58 | this, SLOT(slotDirSelected(const QString &) ) ); |
56 | showMaximized(); | 59 | |
60 | |||
57 | file->setYesCancelVisible( false ); // relayout | 61 | file->setYesCancelVisible( false ); // relayout |
58 | } | 62 | } |
59 | QString OFileDialog::mimetype()const | 63 | QString OFileDialog::mimetype()const |
60 | { | 64 | { |
@@ -77,8 +81,9 @@ QString OFileDialog::getOpenFileName(int selector, | |||
77 | { | 81 | { |
78 | QString ret; | 82 | QString ret; |
79 | OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption, | 83 | OFileDialog dlg( caption.isEmpty() ? tr("Open") : caption, |
80 | wid, OFileSelector::OPEN, selector, startDir, file, mimes); | 84 | wid, OFileSelector::OPEN, selector, startDir, file, mimes); |
85 | dlg.showMaximized(); | ||
81 | if( dlg.exec() ) | 86 | if( dlg.exec() ) |
82 | ret = dlg.fileName(); | 87 | ret = dlg.fileName(); |
83 | 88 | ||
84 | return ret; | 89 | return ret; |
@@ -92,8 +97,9 @@ QString OFileDialog::getSaveFileName(int selector, | |||
92 | { | 97 | { |
93 | QString ret; | 98 | QString ret; |
94 | OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption, | 99 | OFileDialog dlg( caption.isEmpty() ? tr("Save") : caption, |
95 | wid, OFileSelector::SAVE, selector, startDir, file, mimes); | 100 | wid, OFileSelector::SAVE, selector, startDir, file, mimes); |
101 | dlg.showMaximized(); | ||
96 | if( dlg.exec() ) | 102 | if( dlg.exec() ) |
97 | ret = dlg.fileName(); | 103 | ret = dlg.fileName(); |
98 | 104 | ||
99 | return ret; | 105 | return ret; |
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index c3a3514..7451c1b 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc | |||
@@ -78,10 +78,10 @@ namespace { | |||
78 | 78 | ||
79 | OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, | 79 | OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, |
80 | const QString &fileName, const QStringList &mimetypes ) : QWidget( wid ) | 80 | const QString &fileName, const QStringList &mimetypes ) : QWidget( wid ) |
81 | { | 81 | { |
82 | 82 | if(wid!=0) | |
83 | resize(wid->width(),wid->height()); | 83 | resize(wid->width(),wid->height()); |
84 | m_selector = selector; | 84 | m_selector = selector; |
85 | m_currentDir = dirName; | 85 | m_currentDir = dirName; |
86 | m_name = fileName; | 86 | m_name = fileName; |
87 | m_mimetypes = mimetypes; | 87 | m_mimetypes = mimetypes; |
@@ -193,8 +193,9 @@ void OFileSelector::init() | |||
193 | m_stack->addWidget(m_select, NORMAL ); | 193 | m_stack->addWidget(m_select, NORMAL ); |
194 | m_lay->addWidget(m_stack ); | 194 | m_lay->addWidget(m_stack ); |
195 | m_stack->raiseWidget(NORMAL ); | 195 | m_stack->raiseWidget(NORMAL ); |
196 | connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); | 196 | connect(m_select, SIGNAL(fileSelected( const DocLnk &) ), this, SLOT(slotFileBridgeSelected(const DocLnk &) ) ); |
197 | m_pseudoLayout = 0l; | ||
197 | }else { | 198 | }else { |
198 | initializeListView(); | 199 | initializeListView(); |
199 | } | 200 | } |
200 | 201 | ||
@@ -594,9 +595,10 @@ void OFileSelector::slotViewCheck(const QString &view ){ | |||
594 | delete m_docButton; | 595 | delete m_docButton; |
595 | delete m_location; | 596 | delete m_location; |
596 | delete m_up; | 597 | delete m_up; |
597 | delete m_pseudo; | 598 | delete m_pseudo; |
598 | delete m_pseudoLayout; | 599 | if(m_pseudoLayout!=0 ) |
600 | delete m_pseudoLayout; | ||
599 | } | 601 | } |
600 | m_View = 0; | 602 | m_View = 0; |
601 | m_boxToolbar = 0; | 603 | m_boxToolbar = 0; |
602 | m_homeButton = 0; | 604 | m_homeButton = 0; |
@@ -623,22 +625,9 @@ void OFileSelector::slotViewCheck(const QString &view ){ | |||
623 | m_select = 0; | 625 | m_select = 0; |
624 | delete m_View; | 626 | delete m_View; |
625 | m_View = 0; | 627 | m_View = 0; |
626 | 628 | ||
627 | delete m_boxToolbar; | 629 | |
628 | delete m_homeButton; | ||
629 | delete m_docButton; | ||
630 | delete m_location; | ||
631 | delete m_up; | ||
632 | delete m_pseudo; | ||
633 | delete m_pseudoLayout; | ||
634 | m_boxToolbar = 0; | ||
635 | m_homeButton = 0; | ||
636 | m_docButton = 0; | ||
637 | m_location = 0; | ||
638 | m_up = 0; | ||
639 | m_pseudo = 0; | ||
640 | m_pseudoLayout = 0; | ||
641 | 630 | ||
642 | m_selector = EXTENDED; | 631 | m_selector = EXTENDED; |
643 | // create the ListView or IconView | 632 | // create the ListView or IconView |
644 | initializeListView(); | 633 | initializeListView(); |
@@ -649,22 +638,8 @@ void OFileSelector::slotViewCheck(const QString &view ){ | |||
649 | delete m_select; | 638 | delete m_select; |
650 | m_select = 0; | 639 | m_select = 0; |
651 | delete m_View; | 640 | delete m_View; |
652 | m_View = 0; | 641 | m_View = 0; |
653 | delete m_boxToolbar; | ||
654 | delete m_homeButton; | ||
655 | delete m_docButton; | ||
656 | delete m_location; | ||
657 | delete m_up; | ||
658 | delete m_pseudo; | ||
659 | delete m_pseudoLayout; | ||
660 | m_boxToolbar = 0; | ||
661 | m_homeButton = 0; | ||
662 | m_docButton = 0; | ||
663 | m_location = 0; | ||
664 | m_up = 0; | ||
665 | m_pseudo = 0; | ||
666 | m_pseudoLayout = 0; | ||
667 | 642 | ||
668 | m_selector = EXTENDED_ALL; | 643 | m_selector = EXTENDED_ALL; |
669 | initializeListView(); | 644 | initializeListView(); |
670 | reparse(); | 645 | reparse(); |
@@ -700,9 +675,10 @@ void OFileSelector::initializeListView() | |||
700 | delete m_docButton; | 675 | delete m_docButton; |
701 | delete m_location; | 676 | delete m_location; |
702 | delete m_up; | 677 | delete m_up; |
703 | delete m_pseudo; | 678 | delete m_pseudo; |
704 | delete m_pseudoLayout; | 679 | if(m_pseudoLayout!=0 ) // why did you overload malloc |
680 | delete m_pseudoLayout; | ||
705 | m_boxToolbar = 0; | 681 | m_boxToolbar = 0; |
706 | m_homeButton = 0; | 682 | m_homeButton = 0; |
707 | m_docButton = 0; | 683 | m_docButton = 0; |
708 | m_location = 0; | 684 | m_location = 0; |