Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
todbot committed Jun 2, 2014
1 parent 3053251 commit 9f267cc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 36 deletions.
5 changes: 3 additions & 2 deletions qt/blink1control/blink1control.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ QML_IMPORT_PATH =
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
qtcAddDeployment()

TARGET = Blink1Control#test2
TARGET = Blink1Control
VERSION = 0.9.8
TEMPLATE = app

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

QMAKE_CXXFLAGS += -DUSE_HIDAPI
#QMAKE_CFLAGS += -DUSE_HIDAPI
INCLUDEPATH += $$BLINK1_LIB_DIR $$BLINK1_LIB_DIR/hidapi/hidapi $$BLINK1_LIB_DIR/../hardware/firmware
INCLUDEPATH += $$BLINK1_LIB_DIR
#$$BLINK1_LIB_DIR/hidapi/hidapi $$BLINK1_LIB_DIR/../hardware/firmware
DEPENDPATH += $$BLINK1_LIB_DIR

# for tasteful-server
Expand Down
26 changes: 2 additions & 24 deletions qt/blink1control/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,9 @@
#include <QApplication>
int main(int argc, char *argv[])
{

/*
// potential fix for
// "Failed to load platform plugin “cocoa”" error during deplay
// http://qt-project.org/forums/viewthread/26446
if deploy:
print("DEPLOY")
for path in QApplication.libraryPaths():
QApplication.removeLibraryPath(path)
filePath = os.path.dirname(os.path.abspath( __file__ ))
# abspath returns "APP_DIR/Contents/Resouces". This isn't same to C++ app.
fileDir = QDir(filePath)
fileDir.cdUp()
fileDir.cd("PlugIns")
appPath = fileDir.absolutePath()
QApplication.addLibraryPath(str(appPath))
print("INIT: " + str(QApplication.libraryPaths()))
QApplication(sys.argv)
//todbot */
QApplication a(argc, argv);
QApplication::setApplicationName("blink1controlqt");
// is this info used ever? is it for the plist?
QApplication::setApplicationName("blink1control");
QApplication::setApplicationVersion("0.9.9");
QApplication::setOrganizationName("ThingM");
QApplication::setOrganizationDomain("thingm.com");
Expand Down
7 changes: 5 additions & 2 deletions qt/blink1control/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,12 @@ void MainWindow::loadSettings()

// read only patterns
QJsonDocument doc = QJsonDocument::fromJson( patternsReadOnly.toLatin1() );
//qDebug() << patternsReadOnly;
//qDebug() << doc.toJson();
if( doc.isNull() ) {
qDebug() << "ERROR!: patternsReadOnly syntax error!";
}
//qDebug() << doc.toJson( QJsonDocument::Indented );
QJsonArray qarr = doc.array();

for( int i=0; i< qarr.size(); i++ ) {
Blink1Pattern* bp = new Blink1Pattern();
bp->fromJson( qarr.at(i).toObject() );
Expand Down
20 changes: 12 additions & 8 deletions qt/blink1control/patternsReadOnly.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,26 @@ QString patternsReadOnly =
" \"readonly\": true, \"system\": true, "
" \"pattern\": \"3,#ff00ff,0.5,0,#000000,0.5,\" },"

"{ \"date\": 995, \"name\": \"patternA\","

"{ \"date\": 993, \"name\": \"groovy\","
" \"readonly\": true, \"system\": true, "
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#00ff00,0.1,0\" },"
" \"pattern\": \"3,#ff4cff,1.0,0, #630000,0.2,0,#0000ff,0.1,0\" },"

"{ \"date\": 994, \"name\": \"patternB\","
"{ \"date\": 960, \"name\": \"policecar\","
" \"readonly\": true, \"system\": true, "
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#0000ff,0.1,0\" },"
" \"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\" },"

"{ \"date\": 993, \"name\": \"groovy\","
"{ \"date\": 959, \"name\": \"fireengine\","
" \"readonly\": true, \"system\": true, "
" \"pattern\": \"3,#ff4cff,1.0,0, #630000,0.2,0,#0000ff,0.1,0\" },"
" \"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\" },"

"{ \"date\": 993, \"name\": \"policecar\","
"{ \"date\": 800, \"name\": \"patternA\","
" \"readonly\": true, \"system\": true, "
" \"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\" }"
" \"pattern\": \"3,#ff4cff,0.7,0,#630000,0.2,0,#00ff00,0.1,0\" },"

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

" ]";

Expand Down

0 comments on commit 9f267cc

Please sign in to comment.