mirror of
https://github.com/fergalmoran/flameshot.git
synced 2025-12-22 09:51:06 +00:00
FileSystemWatcher: update after file deletion only
This commit is contained in:
@@ -38,12 +38,11 @@ ConfigWindow::ConfigWindow(QWidget *parent) : QTabWidget(parent) {
|
||||
setWindowTitle(tr("Configuration"));
|
||||
|
||||
auto changedSlot = [this](QString s){
|
||||
Q_UNUSED(s);
|
||||
this->m_configWatcher->removePath(s);
|
||||
this->m_configWatcher->addPath(s);
|
||||
if(!this->hasFocus()) {
|
||||
Q_EMIT updateComponents();
|
||||
QStringList files = m_configWatcher->files();
|
||||
if (!files.contains(s)) {
|
||||
this->m_configWatcher->addPath(s);
|
||||
}
|
||||
Q_EMIT updateChildren();
|
||||
};
|
||||
m_configWatcher = new QFileSystemWatcher(this);
|
||||
m_configWatcher->addPath(ConfigHandler().configFilePath());
|
||||
@@ -97,10 +96,6 @@ ConfigWindow::ConfigWindow(QWidget *parent) : QTabWidget(parent) {
|
||||
m_generalConfig, &GeneneralConf::updateComponents);
|
||||
}
|
||||
|
||||
void ConfigWindow::updateComponents() {
|
||||
Q_EMIT updateChildren();
|
||||
}
|
||||
|
||||
void ConfigWindow::keyPressEvent(QKeyEvent *e) {
|
||||
if (e->key() == Qt::Key_Escape) {
|
||||
close();
|
||||
|
||||
@@ -31,9 +31,6 @@ class ConfigWindow : public QTabWidget {
|
||||
public:
|
||||
explicit ConfigWindow(QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void updateComponents();
|
||||
|
||||
signals:
|
||||
void updateChildren();
|
||||
|
||||
|
||||
@@ -147,6 +147,6 @@ void Controller::sendTrayNotification(
|
||||
|
||||
void Controller::updateConfigComponents() {
|
||||
if (m_configWindow) {
|
||||
m_configWindow->updateComponents();
|
||||
m_configWindow->updateChildren();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user