Skip to content

Commit 71d2ef9

Browse files
committed
Qt: set LDrawZip path after library download
1 parent 483dddd commit 71d2ef9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

QT/ModelViewerWidget.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,12 +1092,15 @@ bool ModelViewerWidget::installLDraw(void)
10921092
{
10931093
char *ldrawParentDir = getLDrawDir();
10941094
char *ldrawDir = copyString(ldrawParentDir, 255);
1095+
char *ldrawZip = copyString(ldrawParentDir, 255);
1096+
10951097
QDir originalDir = QDir::current();
10961098
bool progressDialogClosed = false;
10971099

10981100
libraryUpdateFinished = false;
10991101
strcat(ldrawDir, "/ldraw");
1100-
1102+
strcat(ldrawZip, "/ldraw/complete.zip");
1103+
11011104
QDir dir(ldrawDir);
11021105
if (!dir.exists())
11031106
{
@@ -1157,6 +1160,8 @@ bool ModelViewerWidget::installLDraw(void)
11571160
{
11581161
LDLModel::setLDrawDir(ldrawDir);
11591162
preferences->setLDrawDir(ldrawDir);
1163+
LDLModel::setLDrawZipPath(ldrawZip);
1164+
preferences->setLDrawZipPath(ldrawZip);
11601165
}
11611166
delete ldrawDir;
11621167
return libraryUpdateFinished;

QT/Preferences.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,11 @@ char *Preferences::getLDrawZipPath(void)
12091209
return TCUserDefaults::stringForKey(LDRAWZIP_KEY, NULL, false);
12101210
}
12111211

1212+
void Preferences::setLDrawZipPath(const char *path)
1213+
{
1214+
TCUserDefaults::setStringForKey(path, LDRAWZIP_KEY, false);
1215+
}
1216+
12121217
long Preferences::getMaxRecentFiles(void)
12131218
{
12141219
return TCUserDefaults::longForKey(MAX_RECENT_FILES_KEY, 10, false);

QT/Preferences.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class Preferences : public QDialog, Ui::PreferencesPanel
8787
static char *getLDrawDir(void);
8888
static void setLDrawDir(const char *path);
8989
static char *getLDrawZipPath(void);
90+
static void setLDrawZipPath(const char *path);
9091
static long getMaxRecentFiles(void);
9192
static char *getRecentFile(int index);
9293
static void setRecentFile(int index, char *filename);

0 commit comments

Comments
 (0)