From f34fe4370628985ef1a4a4527cfa85165624e27c Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Mon, 6 Sep 2010 14:10:09 +0000 Subject: [PATCH] Fixed spurious library paths being added to Library Browser. --- src/base/rs_system.cpp | 8 ++++++-- src/forms/librarywidget.cpp | 6 ++++++ src/mainapp/applicationwindow.cpp | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/base/rs_system.cpp b/src/base/rs_system.cpp index 3b73e3e..2a85c83 100644 --- a/src/base/rs_system.cpp +++ b/src/base/rs_system.cpp @@ -456,7 +456,7 @@ QStringList RS_System::getDirectoryList(const QString & subDirectory) if (subDirectory != "library") { #endif - //local (application) directory has priority over other dirs: + // Local (application) directory has priority over other dirs: if (!appDir.isEmpty() && appDir != "/" && appDir != getHomeDir()) { dirList.append(appDir + "/" + subDirectory); @@ -467,7 +467,10 @@ QStringList RS_System::getDirectoryList(const QString & subDirectory) // SuSE style: dirList.append("/usr/X11R6/" + appDirName + "/" + subDirectory); dirList.append("/usr/X11R6/share/" + appDirName + "/" + subDirectory); - dirList.append(getHomeDir() + "/." + appDirName + "/" + subDirectory); +//This is what's picking up crap in .architektonas... +//We'll take it out for now... +//But maybe we can check to see if it's "library" and bypass if so... +// dirList.append(getHomeDir() + "/." + appDirName + "/" + subDirectory); #ifdef __APPLE__ } #endif @@ -518,6 +521,7 @@ QStringList RS_System::getDirectoryList(const QString & subDirectory) { ret += (*it); RS_DEBUG->print((*it).toLatin1().data()); +//printf("System: *it=\"%s\"\n", (*it).toAscii().data()); } } diff --git a/src/forms/librarywidget.cpp b/src/forms/librarywidget.cpp index 8ca7ca1..3f8d67e 100644 --- a/src/forms/librarywidget.cpp +++ b/src/forms/librarywidget.cpp @@ -157,6 +157,11 @@ void LibraryWidget::appendTree(QTreeWidgetItem * item, QString directory) newItem = (item ? new QTreeWidgetItem(item, list) : new QTreeWidgetItem(ui.lvDirectory, list)); } +//This is picking up the directory tree TWICE, but ONLY if there are no thumbnails! +//Actually, only if there is no corresponding thumbnail DIRECTORY under .architektonas... +//Dunno why... +//It was picking up .architektonas from the home directory in rs_system.cpp, that's why! +//printf("LibraryWidget::appendTree: *it=\"%s\"\n", (*it).toAscii().data()); appendTree(newItem, directory + "/" + (*it)); } } @@ -214,6 +219,7 @@ void LibraryWidget::updatePreview(QTreeWidgetItem * item, int /*column*/) newItem = new QListWidgetItem(QIcon(pixmap), label, ui.ivPreview); //Doesn't do what we want... // newItem->setSizeHint(QSize(64, 64)); +//printf("LibraryWidget: label = \"%s\"\n", label.toAscii().data()); } QApplication::restoreOverrideCursor(); diff --git a/src/mainapp/applicationwindow.cpp b/src/mainapp/applicationwindow.cpp index a384573..0566beb 100644 --- a/src/mainapp/applicationwindow.cpp +++ b/src/mainapp/applicationwindow.cpp @@ -215,7 +215,7 @@ void ApplicationWindow::slotRunScript(const QString & name) statusBar()->showMessage(tr("Running script '%1'").arg(name), 2000); QStringList scriptList = RS_SYSTEM->getScriptList(); - scriptList.append(RS_SYSTEM->getHomeDir() + "/.qcad/" + name); + scriptList.append(RS_SYSTEM->getHomeDir() + "/.architektonas/" + name); for (QStringList::Iterator it = scriptList.begin(); it!=scriptList.end(); ++it) { -- 2.37.2