Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix edit frame range status when loading w/o browser

John Dancel7243bb38de4e
diff --git a/toonz/sources/toonz/versioncontrol.cpp b/toonz/sources/toonz/versioncontrol.cpp
index 1e02c67f8..c99423fa6 100644
--- a/toonz/sources/toonz/versioncontrol.cpp
+++ b/toonz/sources/toonz/versioncontrol.cpp
@@ -15,9 +15,11 @@
#include "toonz/palettecontroller.h"
#include "toonz/tpalettehandle.h"
#include "toonz/tscenehandle.h"
+#include "toonz/tproject.h"
#include "tsystem.h"
#include "tenv.h"
#include "tapp.h"
+#include "permissionsmanager.h"
#include <QFile>
#include <QDir>
@@ -316,6 +318,18 @@ VersionControlManager *VersionControlManager::instance() {
}
//-----------------------------------------------------------------------------
+void setVersionControlCredentials(QString currentPath) {
+ VersionControl *vc = VersionControl::instance();
+ QList<SVNRepository> repositories = vc->getRepositories();
+ int repoCount = repositories.size();
+ for (int i = 0; i < repoCount; i++) {
+ SVNRepository r = repositories.at(i);
+ if (!currentPath.startsWith(r.m_localPath)) continue;
+ vc->setUserName(r.m_username);
+ vc->setPassword(r.m_password);
+ return;
+ }
+}
void VersionControlManager::setFrameRange(TLevelSet *levelSet,
bool deleteLater) {
@@ -340,8 +354,10 @@ void VersionControlManager::setFrameRange(TLevelSet *levelSet,
TFilePath parentDir =
sl->getScene()->decodeFilePath(sl->getPath().getParentDir());
if (VersionControl::instance()->isFolderUnderVersionControl(
- toQString(parentDir)))
+ toQString(parentDir))) {
checkVersionControl = true;
+ setVersionControlCredentials(toQString(parentDir));
+ }
}
if (sl && sl->isReadOnly()) {
@@ -435,6 +451,8 @@ void VersionControlManager::onFrameRangeDone(const QString &text) {
}
}
+ setVersionControlCredentials(toQString(currentPath));
+
QString username = VersionControl::instance()->getUserName();
QString hostName = TSystem::getHostName();