Skip to content

Commit

Permalink
android compatibility issue fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Viola <[email protected]>
  • Loading branch information
cagnulein authored and Roberto Viola committed Nov 30, 2020
1 parent 7de4bac commit 2f4b760
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/domyostreadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,12 @@ void domyostreadmill::update()
debug("creating virtual treadmill interface...");
virtualTreadMill = new virtualtreadmill(this, noHeartService);

#ifdef Q_OS_UNIX
#ifdef Q_OS_LINUX
#ifndef Q_OS_ANDROID
// on raspberry, the very first time you run the bridge it doesn't work. let's try in this way
delete virtualTreadMill;
virtualTreadMill = new virtualtreadmill(this, noHeartService);
#endif
#endif
connect(virtualTreadMill,&virtualtreadmill::debug ,this,&domyostreadmill::debug);
}
Expand Down
1 change: 1 addition & 0 deletions src/homeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void homeform::deviceConnected()

void homeform::deviceFound(QString name)
{
if(!name.trimmed().length()) return;
m_info = name + " founded";
emit infoChanged(m_info);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,15 @@ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QS
int main(int argc, char *argv[])
{
#ifdef Q_OS_LINUX
#ifndef Q_OS_ANDROID
if (getuid())
{
printf("Runme as root!\n");
return -1;
}
else printf("%s", "OK, you are root.\n");
#endif
#endif

#ifndef Q_OS_ANDROID
QScopedPointer<QCoreApplication> app(createApplication(argc, argv));
Expand Down

0 comments on commit 2f4b760

Please sign in to comment.