mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
SocketAPI: Use Win32 function SHChangeNotify to notify Explorer.
This commit is contained in:
parent
95a77e5ccc
commit
6cb8134690
3 changed files with 17 additions and 2 deletions
|
@ -276,7 +276,11 @@ void SocketApi::slotUpdateFolderView(const QString& alias)
|
|||
f->syncResult().status() == SyncResult::Problem ||
|
||||
f->syncResult().status() == SyncResult::Error ||
|
||||
f->syncResult().status() == SyncResult::SetupError ) {
|
||||
broadcastMessage(QLatin1String("UPDATE_VIEW"), f->path() );
|
||||
if( Utility::isWindows() ) {
|
||||
Utility::winShellChangeNotify( f->path() );
|
||||
} else {
|
||||
broadcastMessage(QLatin1String("UPDATE_VIEW"), f->path() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -361,6 +361,17 @@ bool Utility::isLinux()
|
|||
#endif
|
||||
}
|
||||
|
||||
void Utility::winShellChangeNotify( const QString& path )
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT,
|
||||
reinterpret_cast<const wchar_t *>(QDir::toNativeSeparators(path).utf16()), NULL );
|
||||
#else
|
||||
qDebug() << Q_FUNC_INFO << " is not implemented on non Windows systems.";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static const char STOPWATCH_END_TAG[] = "_STOPWATCH_END";
|
||||
|
||||
void Utility::StopWatch::start()
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace Utility
|
|||
OWNCLOUDSYNC_EXPORT QDateTime qDateTimeFromTime_t(qint64 t);
|
||||
OWNCLOUDSYNC_EXPORT qint64 qDateTimeToTime_t(const QDateTime &t);
|
||||
|
||||
|
||||
OWNCLOUDSYNC_EXPORT void winShellChangeNotify( const QString& path );
|
||||
|
||||
/**
|
||||
* @brief Convert milliseconds to HMS string.
|
||||
|
|
Loading…
Reference in a new issue