From 48ca25abe384b110a53fd3342fecade90f0b1d3c Mon Sep 17 00:00:00 2001 From: Albert S Date: Wed, 19 Oct 2022 11:56:21 +0200 Subject: [PATCH] gui: mainwindow: Reorder members for readability --- gui/mainwindow.h | 61 ++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 37f7da9..0079b8c 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -23,16 +23,6 @@ class MainWindow : public QMainWindow { Q_OBJECT - public: - explicit MainWindow(QWidget *parent, QString socketPath); - ~MainWindow(); - signals: - void beginSearch(const QString &query); - void startPdfPreviewGeneration(QVector paths, double scalefactor); - - protected: - void closeEvent(QCloseEvent *event) override; - private: DatabaseFactory *dbFactory; SqliteDbService *dbService; @@ -40,40 +30,39 @@ class MainWindow : public QMainWindow IPCPreviewClient ipcPreviewClient; QThread ipcClientThread; QThread syncerThread; + Indexer *indexer; IndexSyncer *indexSyncer; QProgressDialog progressDialog; - - Indexer *indexer; QFileIconProvider iconProvider; - bool previewDirty; QSqlDatabase db; QFutureWatcher> searchWatcher; - void add(QString path, unsigned int page); QVector previewableSearchResults; - void connectSignals(); - void makePreviews(int page); - bool previewTabActive(); - bool indexerTabActive(); - void keyPressEvent(QKeyEvent *event) override; - unsigned int processedPdfPreviews; - void handleSearchResults(const QVector &results); - void handleSearchError(QString error); LooqsQuery contentSearchQuery; - int previewsPerPage; - void createSearchResutlMenu(QMenu &menu, const QFileInfo &fileInfo); - void openDocument(QString path, int num); - void openFile(QString path); - unsigned int currentPreviewGeneration = 1; - void initSettingsTabs(); - int currentSelectedScale(); - void processShortcut(int key); - bool eventFilter(QObject *object, QEvent *event); QVector searchHistory; int currentSearchHistoryIndex = 0; QString currentSavedSearchText; QHash previewOrder; /* Quick lookup for the order a preview should have */ QMap previewWidgetOrderCache /* Saves those that arrived out of order to be inserted later at the correct pos */; + bool previewDirty; + int previewsPerPage; + unsigned int processedPdfPreviews; + unsigned int currentPreviewGeneration = 1; + + void connectSignals(); + void makePreviews(int page); + bool previewTabActive(); + bool indexerTabActive(); + void keyPressEvent(QKeyEvent *event) override; + void handleSearchResults(const QVector &results); + void handleSearchError(QString error); + void createSearchResutlMenu(QMenu &menu, const QFileInfo &fileInfo); + void openDocument(QString path, int num); + void openFile(QString path); + void initSettingsTabs(); + int currentSelectedScale(); + void processShortcut(int key); + bool eventFilter(QObject *object, QEvent *event); private slots: void lineEditReturnPressed(); @@ -94,6 +83,16 @@ class MainWindow : public QMainWindow void startIpcPreviews(RenderConfig config, const QVector &targets); void stopIpcPreviews(); void beginIndexSync(); + + public: + explicit MainWindow(QWidget *parent, QString socketPath); + ~MainWindow(); + signals: + void beginSearch(const QString &query); + void startPdfPreviewGeneration(QVector paths, double scalefactor); + + protected: + void closeEvent(QCloseEvent *event) override; }; #endif // MAINWINDOW_H