From afe4c6e9c901b98acf34744116dce7e9fdb413f4 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Fri, 18 Oct 2024 11:31:44 +0200 Subject: [PATCH] resolved blocking bug when double-click on an item in file treeview --- mainwindow.cpp | 14 +++++++++++++- mainwindow.h | 38 +++++++++++++++++++++----------------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index cc48823..7533acd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1144,7 +1144,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD if (item->isExpanded() == false) { info(DEBUGMACRO, "Item is not expanded"); - while (this->rescan) + if (this->rescan) { info(DEBUGMACRO, "Re-scanning path: " + this->connexion.service + "/" + path +"/"); scanDir(&this->connexion, item, this->connexion.service + "/" + path +"/"); @@ -1606,3 +1606,15 @@ void MainWindow::on_actionHiddenService_triggered() preparePopulateTree(); } } + +void MainWindow::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column) +{ + void(); +} + + +void MainWindow::on_treeWidget_doubleClicked(const QModelIndex &index) +{ + void(); +} + diff --git a/mainwindow.h b/mainwindow.h index 249be1d..cb90e4a 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -51,7 +51,7 @@ extern QMap rsyncErrorStrings; class Connexion { - public: + public: int bandwidthLimit = 0; int bandwidthLimitUnit; int contimeout = 20; @@ -70,7 +70,7 @@ class Connexion class Downloading { - public: + public: QString server; QString service; QString path; @@ -86,7 +86,7 @@ class Downloading class About { - public: + public: QString version; QString author = "Daniel TARTAVEL-JEANNOT"; QString licence = "GPL_V3"; @@ -99,7 +99,7 @@ class MainWindow : public QMainWindow { Q_OBJECT - public: + public: Ui::MainWindow *ui; MainWindow(QWidget *parent = nullptr); ~MainWindow(); @@ -124,20 +124,20 @@ class MainWindow : public QMainWindow QList UnitText { - tr("B"), - tr("KB"), - tr("MB"), - tr("GB"), - tr("TB"), - tr("PB") + tr("B"), + tr("KB"), + tr("MB"), + tr("GB"), + tr("TB"), + tr("PB") }; QList bwUnitChar { - 'K', - 'M', - 'T', - 'G', - 'P' + 'K', + 'M', + 'T', + 'G', + 'P' }; QVector downloadProcessErrorString = @@ -175,7 +175,7 @@ class MainWindow : public QMainWindow void passwordStore (QString account, QString password); QString passwordGet (QString account); - private slots: + private slots: void on_listWidget_clicked(); @@ -219,7 +219,11 @@ class MainWindow : public QMainWindow //void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column); - signals: + void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column); + + void on_treeWidget_doubleClicked(const QModelIndex &index); + + signals: void stopDownloading(QProcess *); void progressSignal(int); void speed(QString);