Commit 93793553 authored by Emden R. Gansner's avatar Emden R. Gansner

Partial fix for bug 2477; fix windows build to use the newest attribute list

parent c3ac0b75
......@@ -32,6 +32,38 @@ typedef struct {
int cur;
} rdr_t;
#ifdef WIN32
#define BSZ 1024
QString findAttrFile ()
{
char line[BSZ];
int r;
char* s;
QString path;
MEMORY_BASIC_INFORMATION mbi;
if (VirtualQuery (&findAttrFile, &mbi, sizeof(mbi)) == 0) {
errout << "failed to get handle for executable.\n";
return path;
}
r = GetModuleFileNameA((HMODULE)mbi.AllocationBase, line, BSZ);
if (!r || (r == BSZ)) {
errout << "failed to get path for executable.\n";
return path;
}
s = strstr(line,"\\bin\\");
if (!s) {
errout << "no \"\\bin\" in path " << line << "\n";
return path;
}
*s = '\0';
path.append(line);
path.append("\\share\\graphviz\\gvedit\\attributes.txt");
return path;
}
#endif
bool loadAttrs(const QString fileName, QComboBox * cbNameG,
QComboBox * cbNameN, QComboBox * cbNameE)
{
......@@ -63,6 +95,7 @@ bool loadAttrs(const QString fileName, QComboBox * cbNameG,
} else {
errout << "Could not open attribute name file \"" << fileName <<
"\" for reading\n" << flush;
return true;
}
return false;
......@@ -120,9 +153,15 @@ CFrmSettings::CFrmSettings()
loadAttrs(path + "/attrs.txt", WIDGET(QComboBox, cbNameG),
WIDGET(QComboBox, cbNameN), WIDGET(QComboBox, cbNameE));
#else
loadAttrs("../share/graphviz/gvedit/attributes.txt",
if (loadAttrs("../share/graphviz/gvedit/attributes.txt",
WIDGET(QComboBox, cbNameG), WIDGET(QComboBox, cbNameN),
WIDGET(QComboBox, cbNameE))) {
path = findAttrFile();
if (!path.isEmpty())
loadAttrs(path,
WIDGET(QComboBox, cbNameG), WIDGET(QComboBox, cbNameN),
WIDGET(QComboBox, cbNameE));
}
#endif
setWindowIcon(QIcon(":/images/icon.png"));
}
......
......@@ -109,9 +109,10 @@ copy /Y %outputDir%*.lib %targetDir%lib\release\lib
copy /Y %outputDir%*.dll %targetDir%lib\release\dll
REM *****************************************************
REM Copy smyrna shared files
REM Copy smyrna and gvedit shared files
xcopy /Y %buildDir%share\gui %targetDir%share\graphviz\smyrna\ /S
xcopy /Y %buildDir%share\examples %targetDir%share\graphviz\examples\ /S
copy /Y %buildDir%doc\infosrc\attrs %targetDir%share\graphviz\gvedit\attributes.txt
REM *****************************************************
REM *****************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment