Changeset View
Changeset View
Standalone View
Standalone View
krusader/Dialogs/packgui.cpp
Show All 34 Lines | |||||
35 | 35 | | |||
36 | #include <KCompletion/KHistoryComboBox> | 36 | #include <KCompletion/KHistoryComboBox> | ||
37 | #include <KConfigCore/KSharedConfig> | 37 | #include <KConfigCore/KSharedConfig> | ||
38 | #include <KI18n/KLocalizedString> | 38 | #include <KI18n/KLocalizedString> | ||
39 | 39 | | |||
40 | #define PS(x) lst.contains(x)>0 | 40 | #define PS(x) lst.contains(x)>0 | ||
41 | 41 | | |||
42 | // clear the statics first | 42 | // clear the statics first | ||
43 | QString PackGUI::filename = 0; | 43 | QString PackGUI::filename = nullptr; | ||
44 | QString PackGUI::destination = 0; | 44 | QString PackGUI::destination = nullptr; | ||
45 | QString PackGUI::type = 0; | 45 | QString PackGUI::type = nullptr; | ||
46 | QMap<QString, QString> PackGUI::extraProps; | 46 | QMap<QString, QString> PackGUI::extraProps; | ||
47 | 47 | | |||
48 | PackGUI::PackGUI(QString defaultName, QString defaultPath, int noOfFiles, QString filename) : | 48 | PackGUI::PackGUI(const QString& defaultName, const QString& defaultPath, int noOfFiles, const QString& filename) : | ||
49 | PackGUIBase(0) | 49 | PackGUIBase(nullptr) | ||
50 | { | 50 | { | ||
51 | // first, fill the WhatToPack textfield with information | 51 | // first, fill the WhatToPack textfield with information | ||
52 | if (noOfFiles == 1) | 52 | if (noOfFiles == 1) | ||
53 | TextLabel1->setText(i18n("Pack %1", filename)); | 53 | TextLabel1->setText(i18n("Pack %1", filename)); | ||
54 | else | 54 | else | ||
55 | TextLabel1->setText(i18np("Pack %1 file", "Pack %1 files", noOfFiles)); | 55 | TextLabel1->setText(i18np("Pack %1 file", "Pack %1 files", noOfFiles)); | ||
56 | 56 | | |||
57 | // now, according to the Konfigurator, fill the combobox with the information | 57 | // now, according to the Konfigurator, fill the combobox with the information | ||
Show All 34 Lines | |||||
92 | if (typeData->count() == 0) // if no packers are available | 92 | if (typeData->count() == 0) // if no packers are available | ||
93 | okButton->setEnabled(false); | 93 | okButton->setEnabled(false); | ||
94 | setGeometry(krMainWindow->x() + krMainWindow->width() / 2 - width() / 2, krMainWindow->y() + krMainWindow->height() / 2 - height() / 2, width(), height()); | 94 | setGeometry(krMainWindow->x() + krMainWindow->width() / 2 - width() / 2, krMainWindow->y() + krMainWindow->height() / 2 - height() / 2, width(), height()); | ||
95 | exec(); | 95 | exec(); | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | void PackGUI::browse() | 98 | void PackGUI::browse() | ||
99 | { | 99 | { | ||
100 | QString temp = QFileDialog::getExistingDirectory(0, i18n("Please select a folder"), dirData->text()); | 100 | QString temp = QFileDialog::getExistingDirectory(nullptr, i18n("Please select a folder"), dirData->text()); | ||
101 | if (!temp.isEmpty()) { | 101 | if (!temp.isEmpty()) { | ||
102 | dirData->setText(temp); | 102 | dirData->setText(temp); | ||
103 | } | 103 | } | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | void PackGUI::accept() | 106 | void PackGUI::accept() | ||
107 | { | 107 | { | ||
108 | if (!extraProperties(extraProps)) | 108 | if (!extraProperties(extraProps)) | ||
Show All 19 Lines |