Changeset View
Changeset View
Standalone View
Standalone View
addons/katebuild-plugin/plugin_katebuild.h
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
125 | private: | 125 | private: | ||
126 | void processLine(const QString &); | 126 | void processLine(const QString &); | ||
127 | void addError(const QString &filename, const QString &line, | 127 | void addError(const QString &filename, const QString &line, | ||
128 | const QString &column, const QString &message); | 128 | const QString &column, const QString &message); | ||
129 | bool startProcess(const QString &dir, const QString &command); | 129 | bool startProcess(const QString &dir, const QString &command); | ||
130 | bool checkLocal(const QUrl &dir); | 130 | bool checkLocal(const QUrl &dir); | ||
131 | void clearBuildResults(); | 131 | void clearBuildResults(); | ||
132 | 132 | | |||
133 | void displayBuildResult(const QString &message, KTextEditor::Message::MessageType level); | 133 | /** | ||
134 | * Display a user information on the current active view. | ||||
135 | * @parm message the text to show | ||||
136 | * @parm type the message type | ||||
137 | * @parm autoHideDelay the time the message will be shown. When 0 is the | ||||
138 | * delay set to a sane default, when -1 is auto hide disabled | ||||
139 | * @parm updateOnly when true will an already shown message text updated | ||||
140 | * to @p message and the parameter @p type and @p autoHideDelay | ||||
141 | * will be ignored. Should there no old message exist will a new | ||||
142 | * message created with respect of all arguments | ||||
143 | * | ||||
144 | * @see KTextEditor::message | ||||
145 | */ | ||||
146 | void postMessage(const QString &message, KTextEditor::Message::MessageType type, int autoHideDelay = 0, bool updateOnly = false); | ||||
134 | 147 | | |||
135 | KTextEditor::MainWindow *m_win; | 148 | KTextEditor::MainWindow *m_win; | ||
136 | QWidget *m_toolView; | 149 | QWidget *m_toolView; | ||
137 | Ui::build m_buildUi; | 150 | Ui::build m_buildUi; | ||
138 | QWidget *m_buildWidget; | 151 | QWidget *m_buildWidget; | ||
139 | int m_outputWidgetWidth; | 152 | int m_outputWidgetWidth; | ||
140 | TargetsUi *m_targetsUi; | 153 | TargetsUi *m_targetsUi; | ||
141 | KProcess m_proc; | 154 | KProcess m_proc; | ||
142 | QString m_stdOut; | 155 | QString m_stdOut; | ||
143 | QString m_stdErr; | 156 | QString m_stdErr; | ||
144 | QString m_currentlyBuildingTarget; | 157 | QString m_currentlyBuildingTarget; | ||
158 | int m_hideViewOnSuccess = 0; // Hide view when > 0 | ||||
145 | bool m_buildCancelled; | 159 | bool m_buildCancelled; | ||
146 | int m_displayModeBeforeBuild; | 160 | int m_displayModeBeforeBuild; | ||
147 | QString m_make_dir; | 161 | QString m_make_dir; | ||
148 | QStack<QString> m_make_dir_stack; | 162 | QStack<QString> m_make_dir_stack; | ||
149 | QRegularExpression m_filenameDetector; | 163 | QRegularExpression m_filenameDetector; | ||
150 | QRegularExpression m_filenameDetectorIcpc; | 164 | QRegularExpression m_filenameDetectorIcpc; | ||
151 | bool m_filenameDetectorGccWorked; | 165 | bool m_filenameDetectorGccWorked; | ||
152 | QRegularExpression m_newDirDetector; | 166 | QRegularExpression m_newDirDetector; | ||
153 | unsigned int m_numErrors; | 167 | unsigned int m_numErrors; | ||
154 | unsigned int m_numWarnings; | 168 | unsigned int m_numWarnings; | ||
155 | QString m_prevItemContent; | 169 | QString m_prevItemContent; | ||
156 | QModelIndex m_previousIndex; | 170 | QModelIndex m_previousIndex; | ||
157 | QPointer<KTextEditor::Message> m_infoMessage; | 171 | QPointer<KTextEditor::Message> m_infoMessage; | ||
158 | 172 | | |||
159 | 173 | | |||
160 | /** | 174 | /** | ||
161 | * current project plugin view, if any | 175 | * current project plugin view, if any | ||
162 | */ | 176 | */ | ||
163 | QObject *m_projectPluginView = nullptr; | 177 | QObject *m_projectPluginView = nullptr; | ||
164 | }; | 178 | }; | ||
sars: use QElapsedTimer in stead of a QTimer.
start() the timer in the constructor and when a… | |||||
165 | 179 | | |||
166 | 180 | | |||
167 | typedef QList<QVariant> VariantList; | 181 | typedef QList<QVariant> VariantList; | ||
168 | 182 | | |||
169 | /******************************************************************/ | 183 | /******************************************************************/ | ||
170 | class KateBuildPlugin : public KTextEditor::Plugin | 184 | class KateBuildPlugin : public KTextEditor::Plugin | ||
171 | { | 185 | { | ||
172 | Q_OBJECT | 186 | Q_OBJECT | ||
Show All 10 Lines |
use QElapsedTimer in stead of a QTimer.
start() the timer in the constructor and when a message is to be displayed check eapsed() and start() the timer again when the message is displayed.