Changeset View
Changeset View
Standalone View
Standalone View
plugins/grepview/grepdialog.h
Show All 11 Lines | |||||
12 | ***************************************************************************/ | 12 | ***************************************************************************/ | ||
13 | 13 | | |||
14 | #ifndef KDEVPLATFORM_PLUGIN_GREPDIALOG_H | 14 | #ifndef KDEVPLATFORM_PLUGIN_GREPDIALOG_H | ||
15 | #define KDEVPLATFORM_PLUGIN_GREPDIALOG_H | 15 | #define KDEVPLATFORM_PLUGIN_GREPDIALOG_H | ||
16 | 16 | | |||
17 | #include <QDialog> | 17 | #include <QDialog> | ||
18 | #include <QUrl> | 18 | #include <QUrl> | ||
19 | 19 | | |||
20 | #include "grepjob.h" | ||||
20 | #include "ui_grepwidget.h" | 21 | #include "ui_grepwidget.h" | ||
21 | 22 | | |||
22 | class KConfig; | 23 | class KConfig; | ||
23 | class KUrlRequester; | 24 | class KUrlRequester; | ||
24 | class GrepViewPlugin; | 25 | class GrepViewPlugin; | ||
25 | class QLineEdit; | 26 | class QLineEdit; | ||
26 | 27 | | |||
27 | class GrepDialog : public QDialog, private Ui::GrepWidget | 28 | class GrepDialog : public QDialog, private Ui::GrepWidget | ||
28 | { | 29 | { | ||
29 | Q_OBJECT | 30 | Q_OBJECT | ||
30 | 31 | | |||
31 | public: | 32 | public: | ||
32 | explicit GrepDialog( GrepViewPlugin * plugin, QWidget *parent=nullptr ); | 33 | explicit GrepDialog( GrepViewPlugin * plugin, QWidget *parent=nullptr ); | ||
33 | ~GrepDialog() override; | 34 | ~GrepDialog() override; | ||
34 | 35 | | |||
35 | void setPattern(const QString &pattern); | 36 | void setSettings(const GrepJobSettings &settings); | ||
ematirov: Probably it's better to use "const GrepJobSettings& settings" like in GrepJob. | |||||
36 | void setEnableProjectBox(bool enable); | 37 | GrepJobSettings settings() const; | ||
37 | | ||||
38 | QString patternString() const; | | |||
39 | QString templateString() const; | | |||
40 | QString replacementTemplateString() const; | | |||
41 | QString filesString() const; | | |||
42 | QString excludeString() const; | | |||
43 | | ||||
44 | bool useProjectFilesFlag() const; | | |||
45 | bool regexpFlag() const; | | |||
46 | bool caseSensitiveFlag() const; | | |||
47 | | ||||
48 | int depthValue() const; | | |||
49 | 38 | | |||
50 | public Q_SLOTS: | 39 | public Q_SLOTS: | ||
51 | void startSearch(); | 40 | void startSearch(); | ||
52 | 41 | | |||
53 | ///Sets directory(ies)/files to search in. Also it can be semicolon separated list of directories/files or one of special strings: allOpenFilesString, allOpenProjectsString | 42 | ///Sets directory(ies)/files to search in. Also it can be semicolon separated list of directories/files or one of special strings: allOpenFilesString, allOpenProjectsString | ||
54 | void setSearchLocations(const QString &dir); | 43 | void setSearchLocations(const QString &dir); | ||
55 | 44 | | |||
56 | private Q_SLOTS: | 45 | private Q_SLOTS: | ||
Show All 9 Lines | |||||
66 | void selectDirectoryDialog(); | 55 | void selectDirectoryDialog(); | ||
67 | 56 | | |||
68 | private: | 57 | private: | ||
69 | // Returns the chosen directories or files (only the top directories, not subfiles) | 58 | // Returns the chosen directories or files (only the top directories, not subfiles) | ||
70 | QList< QUrl > getDirectoryChoice() const; | 59 | QList< QUrl > getDirectoryChoice() const; | ||
71 | // Returns whether the given url is a subfile/subdirectory of one of the chosen directories/files | 60 | // Returns whether the given url is a subfile/subdirectory of one of the chosen directories/files | ||
72 | // This is slow, so don't call it too often | 61 | // This is slow, so don't call it too often | ||
73 | bool isPartOfChoice(QUrl url) const; | 62 | bool isPartOfChoice(QUrl url) const; | ||
63 | // Checks what a user has entered into the dialog and saves the data in m_settings | ||||
64 | void updateSettings(); | ||||
74 | 65 | | |||
75 | GrepViewPlugin * m_plugin; | 66 | GrepViewPlugin * m_plugin; | ||
67 | GrepJobSettings m_settings; | ||||
76 | }; | 68 | }; | ||
77 | 69 | | |||
78 | 70 | | |||
79 | #endif | 71 | #endif | ||
80 | 72 | |
Probably it's better to use "const GrepJobSettings& settings" like in GrepJob.