2022-01-28 15:56:11 +01:00
|
|
|
/*
|
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
|
|
|
* Copyright (C) 2007-2021 Cppcheck team.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-01-01 09:22:11 +01:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2022-02-02 16:17:28 +01:00
|
|
|
#include <QFileSystemModel>
|
2018-01-01 09:22:11 +01:00
|
|
|
#include <QMainWindow>
|
2022-03-23 18:16:22 +01:00
|
|
|
#include <QRegularExpression>
|
2019-01-14 17:49:10 +01:00
|
|
|
#include <QString>
|
2018-01-01 09:22:11 +01:00
|
|
|
|
2021-04-03 21:30:50 +02:00
|
|
|
class QListWidgetItem;
|
|
|
|
class QTextStream;
|
2018-01-01 09:22:11 +01:00
|
|
|
namespace Ui {
|
2018-01-01 10:52:51 +01:00
|
|
|
class MainWindow;
|
2018-01-01 09:22:11 +01:00
|
|
|
}
|
|
|
|
|
2018-01-01 10:52:51 +01:00
|
|
|
class MainWindow : public QMainWindow {
|
2018-01-01 09:22:11 +01:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-03-11 21:42:46 +01:00
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
2018-05-01 10:55:06 +02:00
|
|
|
MainWindow(const MainWindow &) = delete;
|
|
|
|
MainWindow &operator=(const MainWindow &) = delete;
|
2022-03-13 20:07:58 +01:00
|
|
|
~MainWindow() override;
|
2018-01-01 09:22:11 +01:00
|
|
|
|
|
|
|
public slots:
|
2018-01-02 23:39:30 +01:00
|
|
|
void loadFile();
|
2019-01-14 17:49:10 +01:00
|
|
|
void loadFromClipboard();
|
2019-06-15 14:37:02 +02:00
|
|
|
void filter(QString filter);
|
2018-01-01 09:22:11 +01:00
|
|
|
void showResult(QListWidgetItem *item);
|
2019-03-09 11:01:22 +01:00
|
|
|
void refreshResults();
|
2022-03-11 21:42:46 +01:00
|
|
|
void fileTreeFilter(const QString &str);
|
2019-11-01 09:29:00 +01:00
|
|
|
void findInFilesClicked();
|
|
|
|
void directorytreeDoubleClick();
|
|
|
|
void searchResultsDoubleClick();
|
2021-12-22 18:58:11 +01:00
|
|
|
void resultsContextMenu(const QPoint& pos);
|
2018-01-01 09:22:11 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
2019-01-12 09:16:43 +01:00
|
|
|
|
2019-01-14 17:49:10 +01:00
|
|
|
void load(QTextStream &textStream);
|
2019-01-12 09:16:43 +01:00
|
|
|
bool runProcess(const QString &programName, const QStringList & arguments);
|
2019-02-16 17:52:36 +01:00
|
|
|
bool wget(const QString &url);
|
|
|
|
bool unpackArchive(const QString &archiveName);
|
2019-11-01 09:29:00 +01:00
|
|
|
void showSrcFile(const QString &fileName, const QString &url, const int lineNumber);
|
2019-03-09 11:01:22 +01:00
|
|
|
|
|
|
|
QStringList mAllErrors;
|
2019-11-04 07:10:31 +01:00
|
|
|
QFileSystemModel mFSmodel;
|
2022-03-23 18:16:22 +01:00
|
|
|
const QRegularExpression mVersionRe;
|
2019-11-04 07:10:31 +01:00
|
|
|
|
|
|
|
const QStringList hFiles;
|
|
|
|
const QStringList srcFiles;
|
2018-01-01 09:22:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|