Skip to content

Commit 9f267cc

Browse files
committed
minor cleanup
1 parent 3053251 commit 9f267cc

File tree

4 files changed

+22
-36
lines changed

4 files changed

+22
-36
lines changed

qt/blink1control/blink1control.pro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ QML_IMPORT_PATH =
2323
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
2424
qtcAddDeployment()
2525

26-
TARGET = Blink1Control#test2
26+
TARGET = Blink1Control
2727
VERSION = 0.9.8
2828
TEMPLATE = app
2929

@@ -66,7 +66,8 @@ win32: LIBS += $$BLINK1_LIB_DIR/blink1-lib.dll
6666

6767
QMAKE_CXXFLAGS += -DUSE_HIDAPI
6868
#QMAKE_CFLAGS += -DUSE_HIDAPI
69-
INCLUDEPATH += $$BLINK1_LIB_DIR $$BLINK1_LIB_DIR/hidapi/hidapi $$BLINK1_LIB_DIR/../hardware/firmware
69+
INCLUDEPATH += $$BLINK1_LIB_DIR
70+
#$$BLINK1_LIB_DIR/hidapi/hidapi $$BLINK1_LIB_DIR/../hardware/firmware
7071
DEPENDPATH += $$BLINK1_LIB_DIR
7172

7273
# for tasteful-server

qt/blink1control/main.cpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,9 @@
22
#include <QApplication>
33
int main(int argc, char *argv[])
44
{
5-
6-
/*
7-
// potential fix for
8-
// "Failed to load platform plugin “cocoa”" error during deplay
9-
// http://qt-project.org/forums/viewthread/26446
10-
11-
if deploy:
12-
print("DEPLOY")
13-
for path in QApplication.libraryPaths():
14-
QApplication.removeLibraryPath(path)
15-
16-
filePath = os.path.dirname(os.path.abspath( __file__ ))
17-
# abspath returns "APP_DIR/Contents/Resouces". This isn't same to C++ app.
18-
fileDir = QDir(filePath)
19-
fileDir.cdUp()
20-
fileDir.cd("PlugIns")
21-
appPath = fileDir.absolutePath()
22-
QApplication.addLibraryPath(str(appPath))
23-
24-
print("INIT: " + str(QApplication.libraryPaths()))
25-
QApplication(sys.argv)
26-
27-
//todbot */
285
QApplication a(argc, argv);
29-
QApplication::setApplicationName("blink1controlqt");
6+
// is this info used ever? is it for the plist?
7+
QApplication::setApplicationName("blink1control");
308
QApplication::setApplicationVersion("0.9.9");
319
QApplication::setOrganizationName("ThingM");
3210
QApplication::setOrganizationDomain("thingm.com");

qt/blink1control/mainwindow.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,12 @@ void MainWindow::loadSettings()
602602

603603
// read only patterns
604604
QJsonDocument doc = QJsonDocument::fromJson( patternsReadOnly.toLatin1() );
605-
//qDebug() << patternsReadOnly;
606-
//qDebug() << doc.toJson();
605+
if( doc.isNull() ) {
606+
qDebug() << "ERROR!: patternsReadOnly syntax error!";
607+
}
608+
//qDebug() << doc.toJson( QJsonDocument::Indented );
607609
QJsonArray qarr = doc.array();
610+
608611
for( int i=0; i< qarr.size(); i++ ) {
609612
Blink1Pattern* bp = new Blink1Pattern();
610613
bp->fromJson( qarr.at(i).toObject() );

qt/blink1control/patternsReadOnly.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,26 @@ QString patternsReadOnly =
2727
" \"readonly\": true, \"system\": true, "
2828
" \"pattern\": \"3,#ff00ff,0.5,0,#000000,0.5,\" },"
2929

30-
"{ \"date\": 995, \"name\": \"patternA\","
30+
31+
"{ \"date\": 993, \"name\": \"groovy\","
3132
" \"readonly\": true, \"system\": true, "
32-
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#00ff00,0.1,0\" },"
33+
" \"pattern\": \"3,#ff4cff,1.0,0, #630000,0.2,0,#0000ff,0.1,0\" },"
3334

34-
"{ \"date\": 994, \"name\": \"patternB\","
35+
"{ \"date\": 960, \"name\": \"policecar\","
3536
" \"readonly\": true, \"system\": true, "
36-
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#0000ff,0.1,0\" },"
37+
" \"pattern\": \"6, #ff0000,0.3,1, #0000ff,0.3,2, #000000,0.1,0, #ff0000,0.3,2, #0000ff,0.3,1, #000000,0.1,0\" },"
3738

38-
"{ \"date\": 993, \"name\": \"groovy\","
39+
"{ \"date\": 959, \"name\": \"fireengine\","
3940
" \"readonly\": true, \"system\": true, "
40-
" \"pattern\": \"3,#ff4cff,1.0,0, #630000,0.2,0,#0000ff,0.1,0\" },"
41+
" \"pattern\": \"6, #ff0000,0.3,1, #ff0000,0.3,2, #000000,0.1,0, #ff0000,0.3,2, #ff0000,0.3,1, #000000,0.1,0\" },"
4142

42-
"{ \"date\": 993, \"name\": \"policecar\","
43+
"{ \"date\": 800, \"name\": \"patternA\","
4344
" \"readonly\": true, \"system\": true, "
44-
" \"pattern\": \"6, #ff0000,0.3,1, #0000ff,0.3,2, #000000,0.1,0, #ff0000,0.3,2, #0000ff,0.3,1, #000000,0.1,0\" }"
45+
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#00ff00,0.1,0\" },"
4546

47+
"{ \"date\": 801, \"name\": \"patternB\","
48+
" \"readonly\": true, \"system\": true, "
49+
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#0000ff,0.1,0\" }"
4650

4751
" ]";
4852

0 commit comments

Comments
 (0)