OK I’m mostly there I think. On linux, I have something that appears to work and only a couple of questions, Windows as usual is problematic. It looks like the git interface uses its own initializer somewhere (although I don’t know where.) On linux changing
src/version/partschecker.cpp
from (where the commented out settings is what is in place everywhere else):
for (i = 0; i < remote_heads_len; i++) {
// we only care about the master branch
if (strcmp(remote_heads[i]->name, "refs/heads/master") == 0) {
char oid[GIT_OID_HEXSZ + 1] = {0};
git_oid_fmt(oid, &remote_heads[i]->oid);
QString soid(oid);
remoteSha = soid;
QSettings settings;
// QSettings settings(FolderUtils::getTopLevelUserDataStorePath() + "/Fritzing.conf", QSettings::NativeFormat);
QString lastPartsSha = settings.value("lastPartsSha", "").toString();
works fine, however changing to this:
for (i = 0; i < remote_heads_len; i++) {
// we only care about the master branch
if (strcmp(remote_heads[i]->name, "refs/heads/master") == 0) {
char oid[GIT_OID_HEXSZ + 1] = {0};
git_oid_fmt(oid, &remote_heads[i]->oid);
QString soid(oid);
remoteSha = soid;
// QSettings settings;
QSettings settings(FolderUtils::getTopLevelUserDataStorePath() + "/Fritzing.conf", QSettings::NativeFormat);
QString lastPartsSha = settings.value("lastPartsSha", "").toString();
settings.setValue("lastPartsSha", soid);
causes this, which I think is fine, it looks to me like gitlib2 has done something qit specific to settings and I just need to leave this alone to do its thing, but having someone that understands this verify that would be good! I think what is happening is that gitlib2 is changing settings somehow I don’t understand to do git specific things and my change breaks it. With the first code snippit, Fritzing seems to run fine, and does not create a Fritzing/Fritzing.conf file (it is in Fritzing-dev/Fritzing.conf as expected.) So I think this should be fine.
partschecker.o /home/vanepp/fritzing-app/src/version/partschecker.cpp
In file included from /home/vanepp/libgit2/include/git2/clone.h:14:0,
from /home/vanepp/libgit2/include/git2.h:20,
from /home/vanepp/fritzing-app/src/version/partschecker.cpp:37:
/home/vanepp/fritzing-app/src/version/partschecker.cpp: In static member function ‘static bool PartsChecker::newPartsAvailable(const QString&, const QString&, bool, QString&, PartsCheckerResult&)’:
/home/vanepp/libgit2/include/git2/remote.h:567:64: warning: missing initializer for member ‘git_remote_callbacks::sideband_progress’ [-Wmissing-field-initializers]
#define GIT_REMOTE_CALLBACKS_INIT {GIT_REMOTE_CALLBACKS_VERSION}
^
/home/vanepp/fritzing-app/src/version/partschecker.cpp:88:35: note: in expansion of macro ‘GIT_REMOTE_CALLBACKS_INIT’
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vanepp/libgit2/include/git2/remote.h:567:64: warning: missing initializer for member ‘git_remote_callbacks::completion’ [-Wmissing-field-initializers]
#define GIT_REMOTE_CALLBACKS_INIT {GIT_REMOTE_CALLBACKS_VERSION}
^
/home/vanepp/fritzing-app/src/version/partschecker.cpp:88:35: note: in expansion of macro ‘GIT_REMOTE_CALLBACKS_INIT’
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vanepp/libgit2/include/git2/remote.h:567:64: warning: missing initializer for member ‘git_remote_callbacks::credentials’ [-Wmissing-field-initializers]
#define GIT_REMOTE_CALLBACKS_INIT {GIT_REMOTE_CALLBACKS_VERSION}
^
/home/vanepp/fritzing-app/src/version/partschecker.cpp:88:35: note: in expansion of macro ‘GIT_REMOTE_CALLBACKS_INIT’
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vanepp/libgit2/include/git2/remote.h:567:64: warning: missing initializer for member ‘git_remote_callbacks::certificate_check’ [-Wmissing-field-initializers]
#define GIT_REMOTE_CALLBACKS_INIT {GIT_REMOTE_CALLBACKS_VERSION}
^
/home/vanepp/fritzing-app/src/version/partschecker.cpp:88:35: note: in expansion of macro ‘GIT_REMOTE_CALLBACKS_INIT’
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vanepp/libgit2/include/git2/remote.h:567:64: warning: missing initializer for member ‘git_remote_callbacks::transfer_progress’ [-Wmissing-field-initializers]
#define GIT_REMOTE_CALLBACKS_INIT {GIT_REMOTE_CALLBACKS_VERSION}
^
/home/vanepp/fritzing-app/src/version/partschecker.cpp:88:35: note: in expansion of macro ‘GIT_REMOTE_CALLBACKS_INIT’
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
^~~~~~~~~~~~~~~~~~~~~~~~~
/home/vanepp/libgit2/include/git2/remote.h:567:64: warning: missing initializer for member ‘git_remote_callbacks::update_tips’ [-Wmissing-field-initializers]
Then on to Windows (still Win7 because my Internet link isn’t in good enough shape to do a download of Qt!). Here I have a couple of questions. Is there a debug mode for phoenix.pro?
When I run it on Win7 it hangs in this line in pri/gitversion.pri
BUILD_DATE = $$system( powershell (Get-Date -Format "o") )
but the command “powershell (Get-Date -Format “o”)” runs fine in a command prompt window, just not when invoced by $$system apparantly. I have worked around this by setting BUILD_DATE to the string the command window delivers but I need to eventually find out what is wrong. Then a problem I haven’t found a workaround for yet. When I add a debug statement here in
src/utils/folderutils.cpp at:
QString FolderUtils::getTopLevelUserDataStorePath() {
QString path = QSettings(QSettings::IniFormat,QSettings::UserScope,“Fritzing”,“Fritzing”).fileName();
//DebugDialog::debug(QString(“getTopLevelUserDataStorePath %1”).arg(QFileInfo(path).dir().absolutePath()) );
DebugDialog::debug(QString("getTopLevelUserDataStorePath "));
return QFileInfo(path).dir().absolutePath();
}
it works on Linux. On Windows I get:
17:55:51: Starting E:\fritzing-dev\debug64\Fritzing…
QWidget: Must construct a QApplication before a QWidget
17:56:22: E:/fritzing-dev/debug64/Fritzing exited with code 3
which seems to be trying to tell me I haven’t initialized the debug widget yet although it works on Linux just fine. I have no idea how to initialize a widget. Windows appears to be using a different directory for the config files than Linux. Nothing gets written in to either of the user directories AppData/Roaming/Fritzing nor User/Docuements/Fritzing in the form of config files, so there must be a third place I don’t know about and that debug statement should tell me where it is if it only worked.
The registry change code for XP shouldn’t be an issue (it should perhaps be updated for Win10, although in a quick search I didn’t find data on how to set this from an application on Win 10, all the instructions are for via the gui.) It is using settings to change the registry and I believe later than XP is ignoring those registy settings so leaving it as is should be fine. If we manage to get it working, it should set the registry to the executable just launched which should be OK, it won’t affect the Fritzing settings values as far as I can see, and that is what we need to avoid.
Peter