Changeset View
Changeset View
Standalone View
Standalone View
src/ksieveui/editor/tests/editorsieve_gui.cpp
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | You should have received a copy of the GNU General Public License along | 13 | You should have received a copy of the GNU General Public License along | ||
14 | with this program; if not, write to the Free Software Foundation, Inc., | 14 | with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 15 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "editorsieve_gui.h" | 18 | #include "editorsieve_gui.h" | ||
19 | #include <QDebug> | 19 | #include <QDebug> | ||
20 | #include "ksieveui/editor/sieveeditor.h" | 20 | #include "ksieveui/editor/sieveeditor.h" | ||
21 | #include <PimCommon/SieveSyntaxHighlighterUtil> | 21 | #include "ksieveui/tests/capability.h" | ||
22 | 22 | | |||
23 | #include <qapplication.h> | 23 | #include <qapplication.h> | ||
24 | #include <QCommandLineParser> | 24 | #include <QCommandLineParser> | ||
25 | #include <QStandardPaths> | 25 | #include <QStandardPaths> | ||
26 | 26 | | |||
27 | int main(int argc, char **argv) | 27 | int main(int argc, char **argv) | ||
28 | { | 28 | { | ||
29 | QApplication app(argc, argv); | 29 | QApplication app(argc, argv); | ||
30 | QStandardPaths::setTestModeEnabled(true); | 30 | QStandardPaths::setTestModeEnabled(true); | ||
31 | 31 | | |||
32 | QCommandLineParser parser; | 32 | QCommandLineParser parser; | ||
33 | parser.addVersionOption(); | 33 | parser.addVersionOption(); | ||
34 | parser.addHelpOption(); | 34 | parser.addHelpOption(); | ||
35 | 35 | | |||
36 | parser.process(app); | 36 | parser.process(app); | ||
37 | 37 | | |||
38 | SieveEditorTestWidget *dialog = new SieveEditorTestWidget; | 38 | SieveEditorTestWidget *dialog = new SieveEditorTestWidget; | ||
39 | PimCommon::SieveSyntaxHighlighterUtil sieveHighlighterutil; | 39 | const QStringList capabilities = KSieveUi::Test::fullCapabilitiesList(); | ||
40 | const QStringList capabilities = sieveHighlighterutil.fullCapabilities(); | | |||
41 | //Add all capabilities for testing | 40 | //Add all capabilities for testing | ||
42 | dialog->setSieveCapabilities(capabilities); | 41 | dialog->setSieveCapabilities(capabilities); | ||
43 | if (dialog->exec()) { | 42 | if (dialog->exec()) { | ||
44 | qDebug() << " generated script :\n" << dialog->script() << "\n"; | 43 | qDebug() << " generated script :\n" << dialog->script() << "\n"; | ||
45 | } | 44 | } | ||
46 | delete dialog; | 45 | delete dialog; | ||
47 | return 0; | 46 | return 0; | ||
48 | } | 47 | } | ||
Show All 15 Lines |