-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SFTP]优化文件监听的逻辑。 [SFTP]修复提示框在MacOSX无法至顶的缺憾。 [SFTP]清理不再需要的缓存文件。 更换应用图标 [RDP]修复4K屏下,默认非智能拉伸登录远程桌面时,底部出现的空白块问题。 [SFTP] Optimize the logic of file monitoring. [SFTP] Fixed the bug that the prompt box cannot be topped on Mac OS X. [SFTP] Clean up cached files that are no longer needed. Replace the application icon [RDP] Fixed the blank block issue that appears at the bottom when logging into remote desktop with default non-intelligent stretch under 4K screen.
- Loading branch information
Showing
25 changed files
with
268 additions
and
155 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/******************************************************************************************* | ||
* | ||
* Copyright (C) 2023 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved. | ||
* | ||
* Contact: http://www.aoyiduo.com | ||
* | ||
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3] | ||
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
*******************************************************************************************/ | ||
|
||
#include "qkxfilesystemwatcher.h" | ||
|
||
#include <QFileInfo> | ||
#include <QTimer> | ||
|
||
QKxFileSystemWatcher::QKxFileSystemWatcher(QObject *parent) | ||
: QObject(parent) | ||
{ | ||
|
||
} | ||
|
||
QKxFileSystemWatcher::~QKxFileSystemWatcher() | ||
{ | ||
|
||
} | ||
|
||
bool QKxFileSystemWatcher::addPath(const QString &file) | ||
{ | ||
QFileInfo fi(file); | ||
if(!fi.isFile()) { | ||
return false; | ||
} | ||
m_files.insert(file, fi.lastModified()); | ||
|
||
if(m_timer == nullptr) { | ||
m_timer = new QTimer(this); | ||
QObject::connect(m_timer, SIGNAL(timeout()), this, SLOT(onFileCheckTimeout())); | ||
} | ||
if(!m_timer->isActive()) { | ||
m_timer->start(1000); | ||
} | ||
return true; | ||
} | ||
|
||
void QKxFileSystemWatcher::removePath(const QString &file) | ||
{ | ||
m_files.take(file); | ||
} | ||
|
||
QStringList QKxFileSystemWatcher::files() const | ||
{ | ||
return m_files.keys(); | ||
} | ||
|
||
void QKxFileSystemWatcher::onFileCheckTimeout() | ||
{ | ||
for(auto it = m_files.begin(); it != m_files.end(); ) { | ||
QString file = it.key(); | ||
QDateTime dt = it.value(); | ||
QFileInfo fi(file); | ||
if(fi.lastModified() != dt) { | ||
it = m_files.erase(it); | ||
emit fileChanged(file); | ||
}else{ | ||
it++; | ||
} | ||
} | ||
if(m_files.isEmpty()) { | ||
m_timer->stop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/******************************************************************************************* | ||
* | ||
* Copyright (C) 2023 Guangzhou AoYiDuo Network Technology Co.,Ltd. All Rights Reserved. | ||
* | ||
* Contact: http://www.aoyiduo.com | ||
* | ||
* this file is used under the terms of the GPLv3[GNU GENERAL PUBLIC LICENSE v3] | ||
* more information follow the website: https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* | ||
*******************************************************************************************/ | ||
|
||
#ifndef QKXFILESYSTEMWATCHER_H | ||
#define QKXFILESYSTEMWATCHER_H | ||
|
||
#include <QObject> | ||
#include <QPointer> | ||
#include <QMap> | ||
#include <QDateTime> | ||
|
||
class QTimer; | ||
class QKxFileSystemWatcher : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit QKxFileSystemWatcher(QObject *parent = nullptr); | ||
virtual ~QKxFileSystemWatcher(); | ||
|
||
bool addPath(const QString &file); | ||
void removePath(const QString &file); | ||
|
||
QStringList files() const; | ||
|
||
signals: | ||
void fileChanged(const QString &path); | ||
private slots: | ||
void onFileCheckTimeout(); | ||
private: | ||
QMap<QString, QDateTime> m_files; | ||
QPointer<QTimer> m_timer; | ||
}; | ||
|
||
#endif // QKXFILESYSTEMWATCHER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.