Commit 868e3c6f authored by Jarosław Staniek's avatar Jarosław Staniek

KoFileDialog rather belongs to kowidgetutils than kowidgets

KoFileDialog belongs to "Tier 0"

Also move filedialogtester to widgetutils:
* remove all i18n - not needed for the test
* rename to kofiledialogtester
* move to tests/ subdir
* remove main.cpp which is too general file, place main() in KoFileDialogTester.cpp

Differential Revision: https://phabricator.kde.org/D360
parent 6519ea7b
......@@ -37,7 +37,6 @@ set(kowidgets_LIB_SRCS
KoZoomMode.cpp
KoDpi.cpp
KoGlobal.cpp
KoFileDialog.cpp
KoColorPatch.cpp
KoColorPopupAction.cpp
KoColorSetWidget.cpp
......@@ -147,7 +146,6 @@ install( FILES
KoZoomHandler.h
KoZoomMode.h
KoGlobal.h
KoFileDialog.h
KoColorPatch.h
KoStrokeConfigWidget.h
KoFillConfigWidget.h
......@@ -176,14 +174,3 @@ install( FILES
DESTINATION
${INCLUDE_INSTALL_DIR}/calligra
COMPONENT Devel)
set(filedialogtester_SRCS
KoFileDialogTester.cpp
main.cpp
)
ki18n_wrap_ui(filedialogtester_SRCS
KoFileDialogTester.ui
)
add_executable(filedialogtester ${filedialogtester_SRCS})
target_link_libraries(filedialogtester kowidgets)
#include "KoFileDialogTester.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
KoFileDialogTester w;
w.show();
return a.exec();
}
......@@ -7,6 +7,7 @@ set(kowidgetutils_LIB_SRCS
KoUpdater.cpp
KoUpdaterPrivate_p.cpp
KoProperties.cpp
KoFileDialog.cpp
)
......@@ -30,6 +31,7 @@ install(FILES
KoProgressUpdater.h
KoUpdater.h
KoProperties.h
KoFileDialog.h
${CMAKE_CURRENT_BINARY_DIR}/kowidgetutils_export.h
DESTINATION ${INCLUDE_INSTALL_DIR}/calligra
COMPONENT Devel
......
......@@ -20,7 +20,7 @@
#ifndef KOFILEDIALOG_H
#define KOFILEDIALOG_H
#include "kowidgets_export.h"
#include "kowidgetutils_export.h"
#include <QFileDialog>
#include <QString>
......@@ -33,7 +33,7 @@
* Wrapper around QFileDialog providing native file dialogs
* on KDE/Gnome/Windows/OSX/etc.
*/
class KOWIDGETS_EXPORT KoFileDialog : public QObject
class KOWIDGETUTILS_EXPORT KoFileDialog : public QObject
{
Q_OBJECT
......
......@@ -7,3 +7,9 @@ set(kopropertiestest_SRCS KoPropertiesTest.cpp )
kde4_add_unit_test(KoPropertiesTest TESTNAME libs-widgetutils-KoPropertiesTest ${kopropertiestest_SRCS})
target_link_libraries(KoPropertiesTest kowidgetutils KF5::I18n Qt5::Test)
########### next target ###############
set(kofiledialogtester_SRCS KoFileDialogTester.cpp)
qt5_wrap_ui(kofiledialogtester_SRCS KoFileDialogTester.ui)
add_executable(kofiledialogtester ${kofiledialogtester_SRCS})
target_link_libraries(kofiledialogtester kowidgetutils)
......@@ -16,10 +16,11 @@
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KoFileDialogTester.h"
#include "KoFileDialogTester.h"
#include "ui_KoFileDialogTester.h"
#include <QApplication>
#include <QDesktopServices>
#include <QListWidget>
#include <QCheckBox>
......@@ -72,7 +73,7 @@ void KoFileDialogTester::testOpenFile()
{
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::OpenFile, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: OpenFile"));
dlg.setCaption("Testing: OpenFile");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
......@@ -108,7 +109,7 @@ void KoFileDialogTester::testOpenFiles()
{
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::OpenFiles, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: OpenFile"));
dlg.setCaption("Testing: OpenFile");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
......@@ -146,7 +147,7 @@ void KoFileDialogTester::testOpenDirectory()
{
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::OpenDirectory, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: OpenDirectory"));
dlg.setCaption("Testing: OpenDirectory");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
......@@ -184,7 +185,7 @@ void KoFileDialogTester::testImportFile()
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::ImportFile, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: ImportFile"));
dlg.setCaption("Testing: ImportFile");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
......@@ -221,7 +222,7 @@ void KoFileDialogTester::testImportFiles()
{
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::ImportFiles, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: ImportFiles"));
dlg.setCaption("Testing: ImportFiles");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
......@@ -259,7 +260,7 @@ void KoFileDialogTester::testImportDirectory()
{
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::ImportDirectory, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: Import Directory"));
dlg.setCaption("Testing: Import Directory");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
......@@ -296,7 +297,7 @@ void KoFileDialogTester::testSaveFile()
ui->listResults->clear();
KoFileDialog dlg(this, KoFileDialog::SaveFile, ui->txtUniqueKey->text());
dlg.setCaption(i18n("Testing: SaveFile"));
dlg.setCaption("Testing: SaveFile");
dlg.setDefaultDir(QDesktopServices::storageLocation(QDesktopServices::HomeLocation));
if (ui->radioName->isChecked()) {
if (ui->chkSetDefaultFilter->isChecked()) {
......@@ -326,3 +327,12 @@ void KoFileDialogTester::testSaveFile()
ui->lblMime->setText(dlg.selectedMimeType());
ui->txtFilter->setText(dlg.selectedNameFilter());
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
KoFileDialogTester w;
w.show();
return a.exec();
}
......@@ -148,7 +148,7 @@
<item>
<widget class="QCheckBox" name="chkHideNameFilterDetailsOption">
<property name="text">
<string>hide name filter details option</string>
<string>Hide name filter details option</string>
</property>
</widget>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment