]> Shamusworld >> Repos - architektonas/commitdiff
Fixed spurious library paths being added to Library Browser.
authorShamus Hammons <jlhamm@acm.org>
Mon, 6 Sep 2010 14:10:09 +0000 (14:10 +0000)
committerShamus Hammons <jlhamm@acm.org>
Mon, 6 Sep 2010 14:10:09 +0000 (14:10 +0000)
src/base/rs_system.cpp
src/forms/librarywidget.cpp
src/mainapp/applicationwindow.cpp

index 3b73e3ed8d05e6057ee2f1f8b2c7148a565abe42..2a85c838a8d40663e2219e39a0daa4bd976bfe68 100644 (file)
@@ -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());
                }
        }
 
index 8ca7ca1b5f361d746ead6144ad3231f1f9cec3af..3f8d67ecc89450329b289b14e417733d75e75820 100644 (file)
@@ -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();
index a384573862f3d5c499bb9603251915b54a40d70a..0566beb287f12d6aba77a1d1c78b6f1d4cac238e 100644 (file)
@@ -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)
        {