LCOV - code coverage report
Current view: top level - src - mainwindow.h (source / functions) Hit Total Coverage
Test: .lcov.total Lines: 0 1 0.0 %
Date: 2018-06-12 11:27:04 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #ifndef MAINWINDOW_H_
       2             : #define MAINWINDOW_H_
       3             : 
       4             : #include "storemodel.h"
       5             : 
       6             : #include <QFileSystemModel>
       7             : #include <QItemSelectionModel>
       8             : #include <QMainWindow>
       9             : #include <QProcess>
      10             : #include <QTimer>
      11             : 
      12             : #if SINGLE_APP
      13             : class SingleApplication;
      14             : #else
      15             : #define SingleApplication QApplication
      16             : #endif
      17             : 
      18             : #ifdef __APPLE__
      19             : #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
      20             : // http://doc.qt.io/qt-5/qkeysequence.html#qt_set_sequence_auto_mnemonic
      21             : void qt_set_sequence_auto_mnemonic(bool b);
      22             : #endif
      23             : #endif
      24             : 
      25             : namespace Ui {
      26             : class MainWindow;
      27             : }
      28             : 
      29             : /*!
      30             :     \class MainWindow
      31             :     \brief The MainWindow class does way too much, not only is it a switchboard,
      32             :     configuration handler and more, it's also the process-manager.
      33             : 
      34             :     This class could really do with an overhaul.
      35             :  */
      36             : class Pass;
      37             : class TrayIcon;
      38             : class MainWindow : public QMainWindow {
      39           0 :   Q_OBJECT
      40             : 
      41             : public:
      42             :   explicit MainWindow(const QString &searchText = QString(),
      43             :                       QWidget *parent = nullptr);
      44             :   ~MainWindow();
      45             :   bool checkConfig();
      46             :   QStringList getSecretKeys();
      47             :   void generateKeyPair(QString, QDialog *);
      48             :   void userDialog(QString = "");
      49             :   void config();
      50             :   void executePassGitInit();
      51             : 
      52             : protected:
      53             :   void closeEvent(QCloseEvent *event);
      54             :   void keyPressEvent(QKeyEvent *event);
      55             :   void changeEvent(QEvent *event);
      56             :   bool eventFilter(QObject *obj, QEvent *event);
      57             : 
      58             : public slots:
      59             :   void deselect();
      60             : 
      61             : private slots:
      62             :   void addPassword();
      63             :   void addFolder();
      64             :   void onEdit();
      65             :   void onDelete();
      66             :   void onOtp();
      67             :   void onPush();
      68             :   void onUpdate(bool block = false);
      69             :   void onUsers();
      70             :   void onConfig();
      71             :   void on_treeView_clicked(const QModelIndex &index);
      72             :   void on_treeView_doubleClicked(const QModelIndex &index);
      73             :   void processFinished(const QString &, const QString &);
      74             :   void processError(QProcess::ProcessError);
      75             :   void clearClipboard();
      76             :   void clearPanel(bool notify = true);
      77             :   void on_lineEdit_textChanged(const QString &arg1);
      78             :   void on_lineEdit_returnPressed();
      79             :   void messageAvailable(QString message);
      80             :   void on_profileBox_currentIndexChanged(QString);
      81             :   void showContextMenu(const QPoint &pos);
      82             :   void showBrowserContextMenu(const QPoint &pos);
      83             :   void openFolder();
      84             :   void editPassword(const QString &);
      85             :   void focusInput();
      86             :   void copyTextToClipboard(const QString &text);
      87             :   void copyPasswordFromTreeview();
      88             :   void passwordFromFileToClipboard(const QString &text);
      89             : 
      90             :   void executeWrapperStarted();
      91             :   void showStatusMessage(QString msg, int timeout);
      92             :   void startReencryptPath();
      93             :   void endReencryptPath();
      94             :   void critical(QString, QString);
      95             :   void passShowHandler(const QString &);
      96             :   void passOtpHandler(const QString &);
      97             :   void passStoreChanged(const QString &, const QString &);
      98             :   void doGitPush();
      99             : 
     100             :   void processErrorExit(int exitCode, const QString &);
     101             : 
     102             :   void finishedInsert(const QString &, const QString &);
     103             :   void keyGenerationComplete(const QString &p_output, const QString &p_errout);
     104             : 
     105             : private:
     106             :   QScopedPointer<Ui::MainWindow> ui;
     107             :   QFileSystemModel model;
     108             :   StoreModel proxyModel;
     109             :   QScopedPointer<QItemSelectionModel> selectionModel;
     110             :   QProcess fusedav;
     111             :   QString clippedText;
     112             :   QTimer clearPanelTimer;
     113             :   QTimer clearClipboardTimer;
     114             :   bool freshStart;
     115             :   QDialog *keygen;
     116             :   QString currentDir;
     117             :   bool startupPhase;
     118             :   TrayIcon *tray;
     119             : 
     120             :   void initToolBarButtons();
     121             :   void initStatusBar();
     122             : 
     123             :   void updateText();
     124             :   void enableUiElements(bool state);
     125             :   void restoreWindow();
     126             :   void selectFirstFile();
     127             :   QModelIndex firstFile(QModelIndex parentIndex);
     128             :   QString getFile(const QModelIndex &, bool);
     129             :   void setPassword(QString, bool isNew = true);
     130             : 
     131             :   void mountWebDav();
     132             :   void updateProfileBox();
     133             :   void initTrayIcon();
     134             :   void destroyTrayIcon();
     135             :   void clearTemplateWidgets();
     136             :   void reencryptPath(QString dir);
     137             :   void addToGridLayout(int position, const QString &field,
     138             :                        const QString &value);
     139             :   void DisplayInTextBrowser(QString toShow, QString prefix = QString(),
     140             :                             QString postfix = QString());
     141             :   void connectPassSignalHandlers(Pass *pass);
     142             : 
     143             :   void updateGitButtonVisibility();
     144             :   void updateOtpButtonVisibility();
     145             :   void enableGitButtons(const bool &);
     146             : };
     147             : 
     148             : #endif // MAINWINDOW_H_

Generated by: LCOV version 1.13