Add option to ignore symblo link (#1588)

* Add option to ignore symblo link

* Modify parameter names

---------

Co-authored-by: yangheran <heran.yang@seafile.com>
This commit is contained in:
feiniks 2024-12-21 11:54:28 +08:00 committed by GitHub
parent 69b1e05156
commit 4376ac0a95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 1 deletions

View file

@ -57,6 +57,7 @@ const char *kProxyPort = "proxy_port";
const char *kProxyUsername = "proxy_username"; const char *kProxyUsername = "proxy_username";
const char *kProxyPassword = "proxy_password"; const char *kProxyPassword = "proxy_password";
const char *kHideWindowsIncompatiblePathNotification = "hide_windows_incompatible_path_notification"; const char *kHideWindowsIncompatiblePathNotification = "hide_windows_incompatible_path_notification";
const char *kIgnoreSymlinks = "ignore_symlinks";
const char *kRepoSortOrdersGroup = "repo_sort_orders"; const char *kRepoSortOrdersGroup = "repo_sort_orders";
const int kCheckSystemProxyIntervalMSecs = 5 * 1000; const int kCheckSystemProxyIntervalMSecs = 5 * 1000;
@ -721,6 +722,20 @@ void SettingsManager::setHideWindowsIncompatibilityPathMsg(bool enabled)
seafApplet->rpcClient()->seafileSetConfig(kHideWindowsIncompatiblePathNotification, set_value); seafApplet->rpcClient()->seafileSetConfig(kHideWindowsIncompatiblePathNotification, set_value);
return; return;
} }
bool SettingsManager::getIgnoreSymlinks()
{
QString str;
seafApplet->rpcClient()->seafileGetConfig(kIgnoreSymlinks, &str);
return str == "true";
}
void SettingsManager::setIgnoreSymlinks(bool enabled)
{
QString set_value = enabled == true ? "true" : "false";
seafApplet->rpcClient()->seafileSetConfig(kIgnoreSymlinks, set_value);
return;
}
#endif #endif
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32

View file

@ -116,6 +116,8 @@ public:
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) #if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
bool getHideWindowsIncompatibilityPathMsg(); bool getHideWindowsIncompatibilityPathMsg();
void setHideWindowsIncompatibilityPathMsg(bool enabled); void setHideWindowsIncompatibilityPathMsg(bool enabled);
bool getIgnoreSymlinks();
void setIgnoreSymlinks(bool enabled);
#endif #endif
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32

View file

@ -80,7 +80,8 @@ void SettingsDialog::updateSettings()
mgr->setFinderSyncExtension(mFinderSyncCheckBox->checkState() == Qt::Checked); mgr->setFinderSyncExtension(mFinderSyncCheckBox->checkState() == Qt::Checked);
#endif #endif
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) #if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
mgr -> setHideWindowsIncompatibilityPathMsg(mHideWindowsIncompatibilityCheckBox->checkState() == Qt::Checked); mgr->setHideWindowsIncompatibilityPathMsg(mHideWindowsIncompatibilityCheckBox->checkState() == Qt::Checked);
mgr->setIgnoreSymlinks(mIgnoreSymlinksCheckBox->checkState() == Qt::Checked);
#endif #endif
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
@ -156,8 +157,12 @@ void SettingsDialog::showEvent(QShowEvent *event)
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) #if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
state = mgr->getHideWindowsIncompatibilityPathMsg() ? Qt::Checked : Qt::Unchecked; state = mgr->getHideWindowsIncompatibilityPathMsg() ? Qt::Checked : Qt::Unchecked;
mHideWindowsIncompatibilityCheckBox->setCheckState(state); mHideWindowsIncompatibilityCheckBox->setCheckState(state);
state = mgr->getIgnoreSymlinks() ? Qt::Checked : Qt::Unchecked;
mIgnoreSymlinksCheckBox->setCheckState(state);
#else #else
mHideWindowsIncompatibilityCheckBox->hide(); mHideWindowsIncompatibilityCheckBox->hide();
mIgnoreSymlinksCheckBox->hide();
#endif #endif
#if defined(Q_OS_WIN32) #if defined(Q_OS_WIN32)

View file

@ -80,6 +80,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="mIgnoreSymlinksCheckBox">
<property name="text">
<string>Don't sync symbolic links</string>
</property>
</widget>
</item>
<item> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="labelAlignment"> <property name="labelAlignment">