├── LICENSE ├── README.md ├── TTWatcherMain.pro ├── lib └── windows │ ├── x64 │ └── hid.lib │ └── x86 │ └── hid.lib ├── qhttpserver ├── LICENSE ├── README.md ├── TODO ├── docs │ ├── Doxyfile │ └── pages │ │ ├── examples.dox │ │ └── main-page.dox ├── examples │ ├── bodydata │ │ ├── bodydata.cpp │ │ ├── bodydata.h │ │ └── bodydata.pro │ ├── examples.pro │ ├── greeting │ │ ├── greeting.cpp │ │ ├── greeting.h │ │ └── greeting.pro │ └── helloworld │ │ ├── helloworld.cpp │ │ ├── helloworld.h │ │ └── helloworld.pro ├── http-parser │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTIONS │ ├── LICENSE-MIT │ ├── README.md │ ├── http_parser.c │ ├── http_parser.gyp │ ├── http_parser.h │ ├── test.c │ └── url_parser.c ├── qhttpserver.pri ├── qhttpserver.pro └── src │ ├── qhttpconnection.cpp │ ├── qhttpconnection.h │ ├── qhttprequest.cpp │ ├── qhttprequest.h │ ├── qhttpresponse.cpp │ ├── qhttpresponse.h │ ├── qhttpserver.cpp │ ├── qhttpserver.h │ ├── qhttpserverapi.h │ ├── qhttpserverfwd.h │ └── src.pro ├── quazip ├── CMakeLists.txt ├── COPYING ├── Doxyfile ├── FindQuaZip.cmake ├── NEWS.txt ├── README.txt ├── doc │ ├── html │ │ ├── JlCompress_8h_source.html │ │ ├── annotated.html │ │ ├── bc_s.png │ │ ├── classJlCompress-members.html │ │ ├── classJlCompress.html │ │ ├── classQuaAdler32-members.html │ │ ├── classQuaAdler32.html │ │ ├── classQuaAdler32__coll__graph.map │ │ ├── classQuaAdler32__coll__graph.md5 │ │ ├── classQuaAdler32__coll__graph.png │ │ ├── classQuaAdler32__inherit__graph.map │ │ ├── classQuaAdler32__inherit__graph.md5 │ │ ├── classQuaAdler32__inherit__graph.png │ │ ├── classQuaChecksum32-members.html │ │ ├── classQuaChecksum32.html │ │ ├── classQuaChecksum32__inherit__graph.map │ │ ├── classQuaChecksum32__inherit__graph.md5 │ │ ├── classQuaChecksum32__inherit__graph.png │ │ ├── classQuaCrc32-members.html │ │ ├── classQuaCrc32.html │ │ ├── classQuaCrc32__coll__graph.map │ │ ├── classQuaCrc32__coll__graph.md5 │ │ ├── classQuaCrc32__coll__graph.png │ │ ├── classQuaCrc32__inherit__graph.map │ │ ├── classQuaCrc32__inherit__graph.md5 │ │ ├── classQuaCrc32__inherit__graph.png │ │ ├── classQuaGzipFile-members.html │ │ ├── classQuaGzipFile.html │ │ ├── classQuaZIODevice-members.html │ │ ├── classQuaZIODevice.html │ │ ├── classQuaZip-members.html │ │ ├── classQuaZip.html │ │ ├── classQuaZipDir-members.html │ │ ├── classQuaZipDir.html │ │ ├── classQuaZipFile-members.html │ │ ├── classQuaZipFile.html │ │ ├── classQuaZipFilePrivate-members.html │ │ ├── classQuaZipFilePrivate.html │ │ ├── classQuaZipFilePrivate__coll__graph.map │ │ ├── classQuaZipFilePrivate__coll__graph.md5 │ │ ├── classQuaZipFilePrivate__coll__graph.png │ │ ├── classQuaZipFile__coll__graph.map │ │ ├── classQuaZipFile__coll__graph.md5 │ │ ├── classQuaZipFile__coll__graph.png │ │ ├── classQuaZipPrivate-members.html │ │ ├── classQuaZipPrivate.html │ │ ├── classQuaZipPrivate__coll__graph.map │ │ ├── classQuaZipPrivate__coll__graph.md5 │ │ ├── classQuaZipPrivate__coll__graph.png │ │ ├── classQuaZip__coll__graph.map │ │ ├── classQuaZip__coll__graph.md5 │ │ ├── classQuaZip__coll__graph.png │ │ ├── classes.html │ │ ├── closed.png │ │ ├── deprecated.html │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800.html │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.map │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.md5 │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.png │ │ ├── dirs.html │ │ ├── doxygen.css │ │ ├── doxygen.png │ │ ├── faq.html │ │ ├── files.html │ │ ├── functions.html │ │ ├── functions_0x62.html │ │ ├── functions_0x63.html │ │ ├── functions_0x64.html │ │ ├── functions_0x65.html │ │ ├── functions_0x66.html │ │ ├── functions_0x67.html │ │ ├── functions_0x68.html │ │ ├── functions_0x69.html │ │ ├── functions_0x6d.html │ │ ├── functions_0x6e.html │ │ ├── functions_0x6f.html │ │ ├── functions_0x70.html │ │ ├── functions_0x71.html │ │ ├── functions_0x72.html │ │ ├── functions_0x73.html │ │ ├── functions_0x74.html │ │ ├── functions_0x75.html │ │ ├── functions_0x76.html │ │ ├── functions_0x77.html │ │ ├── functions_0x7a.html │ │ ├── functions_0x7e.html │ │ ├── functions_enum.html │ │ ├── functions_eval.html │ │ ├── functions_func.html │ │ ├── functions_vars.html │ │ ├── graph_legend.html │ │ ├── graph_legend.md5 │ │ ├── graph_legend.png │ │ ├── hierarchy.html │ │ ├── index.html │ │ ├── inherit_graph_0.map │ │ ├── inherit_graph_0.md5 │ │ ├── inherit_graph_0.png │ │ ├── inherit_graph_1.map │ │ ├── inherit_graph_1.md5 │ │ ├── inherit_graph_1.png │ │ ├── inherit_graph_10.map │ │ ├── inherit_graph_10.md5 │ │ ├── inherit_graph_10.png │ │ ├── inherit_graph_11.map │ │ ├── inherit_graph_11.md5 │ │ ├── inherit_graph_11.png │ │ ├── inherit_graph_12.map │ │ ├── inherit_graph_12.md5 │ │ ├── inherit_graph_12.png │ │ ├── inherit_graph_2.map │ │ ├── inherit_graph_2.md5 │ │ ├── inherit_graph_2.png │ │ ├── inherit_graph_3.map │ │ ├── inherit_graph_3.md5 │ │ ├── inherit_graph_3.png │ │ ├── inherit_graph_4.map │ │ ├── inherit_graph_4.md5 │ │ ├── inherit_graph_4.png │ │ ├── inherit_graph_5.map │ │ ├── inherit_graph_5.md5 │ │ ├── inherit_graph_5.png │ │ ├── inherit_graph_6.map │ │ ├── inherit_graph_6.md5 │ │ ├── inherit_graph_6.png │ │ ├── inherit_graph_7.map │ │ ├── inherit_graph_7.md5 │ │ ├── inherit_graph_7.png │ │ ├── inherit_graph_8.map │ │ ├── inherit_graph_8.md5 │ │ ├── inherit_graph_8.png │ │ ├── inherit_graph_9.map │ │ ├── inherit_graph_9.md5 │ │ ├── inherit_graph_9.png │ │ ├── inherits.html │ │ ├── jquery.js │ │ ├── nav_f.png │ │ ├── nav_h.png │ │ ├── open.png │ │ ├── pages.html │ │ ├── quaadler32_8h_source.html │ │ ├── quachecksum32_8h_source.html │ │ ├── quacrc32_8h_source.html │ │ ├── quagzipfile_8h_source.html │ │ ├── quaziodevice_8h_source.html │ │ ├── quazip_8h_source.html │ │ ├── quazip__global_8h_source.html │ │ ├── quazipdir_8h_source.html │ │ ├── quazipfile_8h_source.html │ │ ├── quazipfileinfo_8h_source.html │ │ ├── quazipnewinfo_8h_source.html │ │ ├── structQIODevice__descriptor-members.html │ │ ├── structQIODevice__descriptor.html │ │ ├── structQuaZipFileInfo-members.html │ │ ├── structQuaZipFileInfo.html │ │ ├── structQuaZipFileInfo64-members.html │ │ ├── structQuaZipFileInfo64.html │ │ ├── structQuaZipNewInfo-members.html │ │ ├── structQuaZipNewInfo.html │ │ ├── tab_a.png │ │ ├── tab_b.png │ │ ├── tab_h.png │ │ ├── tab_s.png │ │ ├── tabs.css │ │ └── usage.html │ └── latex │ │ ├── Makefile │ │ ├── annotated.tex │ │ ├── classJlCompress.tex │ │ ├── classQuaAdler32.tex │ │ ├── classQuaAdler32__coll__graph.eps │ │ ├── classQuaAdler32__coll__graph.md5 │ │ ├── classQuaAdler32__inherit__graph.eps │ │ ├── classQuaAdler32__inherit__graph.md5 │ │ ├── classQuaChecksum32.tex │ │ ├── classQuaChecksum32__inherit__graph.eps │ │ ├── classQuaChecksum32__inherit__graph.md5 │ │ ├── classQuaCrc32.tex │ │ ├── classQuaCrc32__coll__graph.eps │ │ ├── classQuaCrc32__coll__graph.md5 │ │ ├── classQuaCrc32__inherit__graph.eps │ │ ├── classQuaCrc32__inherit__graph.md5 │ │ ├── classQuaGzipFile.tex │ │ ├── classQuaZIODevice.tex │ │ ├── classQuaZip.tex │ │ ├── classQuaZipDir.tex │ │ ├── classQuaZipFile.tex │ │ ├── classQuaZipFilePrivate.tex │ │ ├── classQuaZipFilePrivate__coll__graph.eps │ │ ├── classQuaZipFilePrivate__coll__graph.md5 │ │ ├── classQuaZipFile__coll__graph.eps │ │ ├── classQuaZipFile__coll__graph.md5 │ │ ├── classQuaZipPrivate.tex │ │ ├── classQuaZipPrivate__coll__graph.eps │ │ ├── classQuaZipPrivate__coll__graph.md5 │ │ ├── classQuaZip__coll__graph.eps │ │ ├── classQuaZip__coll__graph.md5 │ │ ├── deprecated.tex │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800.tex │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.eps │ │ ├── dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.md5 │ │ ├── dirs.tex │ │ ├── doxygen.sty │ │ ├── faq.tex │ │ ├── hierarchy.tex │ │ ├── index.tex │ │ ├── refman.tex │ │ ├── structQIODevice__descriptor.tex │ │ ├── structQuaZipFileInfo.tex │ │ ├── structQuaZipFileInfo64.tex │ │ ├── structQuaZipNewInfo.tex │ │ └── usage.tex ├── includes.pri ├── quazip.pri ├── quazip.pro ├── quazip.sln ├── quazip │ ├── CMakeLists.txt │ ├── JlCompress.cpp │ ├── JlCompress.h │ ├── crypt.h │ ├── debian │ │ └── libquazip0.symbols │ ├── doc │ │ ├── faq.dox │ │ ├── index.dox │ │ └── usage.dox │ ├── ioapi.h │ ├── qioapi.cpp │ ├── quaadler32.cpp │ ├── quaadler32.h │ ├── quachecksum32.h │ ├── quacrc32.cpp │ ├── quacrc32.h │ ├── quagzipfile.cpp │ ├── quagzipfile.h │ ├── quaziodevice.cpp │ ├── quaziodevice.h │ ├── quazip.cpp │ ├── quazip.h │ ├── quazip.pri │ ├── quazip.pro │ ├── quazip.sln │ ├── quazip.vcproj │ ├── quazip.vcxproj │ ├── quazip.vcxproj.filters │ ├── quazip_global.h │ ├── quazipdir.cpp │ ├── quazipdir.h │ ├── quazipfile.cpp │ ├── quazipfile.h │ ├── quazipfileinfo.cpp │ ├── quazipfileinfo.h │ ├── quazipnewinfo.cpp │ ├── quazipnewinfo.h │ ├── run_moc.bat │ ├── unzip.c │ ├── unzip.h │ ├── zip.c │ └── zip.h └── qztest │ ├── coverage.sh │ ├── qztest.cpp │ ├── qztest.h │ ├── qztest.pro │ ├── qztest.sln │ ├── qztest.vcproj │ ├── qztest.vcxproj │ ├── qztest.vcxproj.filters │ ├── run_moc.bat │ ├── testjlcompress.cpp │ ├── testjlcompress.h │ ├── testquachecksum32.cpp │ ├── testquachecksum32.h │ ├── testquagzipfile.cpp │ ├── testquagzipfile.h │ ├── testquaziodevice.cpp │ ├── testquaziodevice.h │ ├── testquazip.cpp │ ├── testquazip.h │ ├── testquazipdir.cpp │ ├── testquazipdir.h │ ├── testquazipfile.cpp │ ├── testquazipfile.h │ ├── testquazipfileinfo.cpp │ ├── testquazipfileinfo.h │ ├── testquazipnewinfo.cpp │ └── testquazipnewinfo.h ├── screenshot1.jpg ├── screenshot2.jpg ├── setup.iss └── src ├── .gitignore ├── 404.html ├── Info.plist ├── Lightmaps.cpp ├── Lightmaps.h ├── SlippyMap.cpp ├── SlippyMap.h ├── aboutdialog.cpp ├── aboutdialog.h ├── aboutdialog.ui ├── activity.cpp ├── activity.h ├── arrow68.png ├── bridge.cpp ├── bridge.h ├── bridgeeditordialog.cpp ├── bridgeeditordialog.h ├── bridgeeditordialog.ui ├── bridgepointitemmodel.cpp ├── bridgepointitemmodel.h ├── centeredexpmovavg.cpp ├── centeredexpmovavg.h ├── datasetdownloadericons.qrc ├── datasmoothing.cpp ├── datasmoothing.h ├── document4.png ├── door9.png ├── downloaddialog.cpp ├── downloaddialog.h ├── downloaddialog.ui ├── elevation.cpp ├── elevation.h ├── elevationdownloaderitem.cpp ├── elevationdownloaderitem.h ├── elevationdownloaderitemmodel.cpp ├── elevationdownloaderitemmodel.h ├── elevationloader.cpp ├── elevationloader.h ├── elevationtile.cpp ├── elevationtile.h ├── elevationtiledownloaderdialog.cpp ├── elevationtiledownloaderdialog.h ├── elevationtiledownloaderdialog.ui ├── empty_tile.png ├── exportworkingdialog.cpp ├── exportworkingdialog.h ├── exportworkingdialog.ui ├── flatfileiconprovider.cpp ├── flatfileiconprovider.h ├── folder250.png ├── geodistance.cpp ├── geodistance.h ├── gridfloatelevationtile.cpp ├── gridfloatelevationtile.h ├── hard13.png ├── heart254.png ├── hid.c ├── hidapi.h ├── hidlinux.c ├── hidmac.c ├── hidpi.h ├── hidsdi.h ├── hidusage.h ├── home10.png ├── httpserver.cpp ├── httpserver.h ├── iactivityexporter.cpp ├── iactivityexporter.h ├── icons ├── boxes37.png ├── gears6.png ├── internet43.png ├── ok.png ├── test20.png └── time28.png ├── iexporterconfig.cpp ├── iexporterconfig.h ├── info28.png ├── lap.cpp ├── lap.h ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── man360.png ├── man360_large.png ├── mountain13.png ├── ned1.txt ├── ned13.txt ├── ned2.txt ├── order32.h ├── qcustomplot.cpp ├── qcustomplot.h ├── qtlocalpeer.cpp ├── qtlocalpeer.h ├── qtlockedfile.cpp ├── qtlockedfile.h ├── qtlockedfile_unix.cpp ├── qtlockedfile_win.cpp ├── qtsingleapplication.cpp ├── qtsingleapplication.h ├── resources.qrc ├── runkeeper.html ├── runkeeper.png ├── runkeeper_auth.h.orig ├── runkeeperexporter.cpp ├── runkeeperexporter.h ├── runkeeperexporterconfig.cpp ├── runkeeperexporterconfig.h ├── running24.png ├── running32.ico ├── running32.png ├── runningman.ico ├── runningman2.icns ├── runningman512.png ├── save-file.png ├── settings.cpp ├── settings.h ├── settings20.png ├── settingsdialog.cpp ├── settingsdialog.h ├── settingsdialog.ui ├── singleshot.cpp ├── singleshot.h ├── smashrun.html ├── smashrun_auth.h.orig ├── smashrunexporter.cpp ├── smashrunexporter.h ├── smashrunexporterconfig.cpp ├── smashrunexporterconfig.h ├── smashrunlogo.png ├── south_florida.bridges ├── srtm.txt ├── srtmelevationtile.cpp ├── srtmelevationtile.h ├── strava.html ├── strava.png ├── strava_auth.h.orig ├── stravaexporter.cpp ├── stravaexporter.h ├── stravaexporterconfig.cpp ├── stravaexporterconfig.h ├── tcx.png ├── tcxactivityexporter.cpp ├── tcxactivityexporter.h ├── tcxexport.cpp ├── tcxexport.h ├── tcxexporterconfig.cpp ├── tcxexporterconfig.h ├── tiles.json ├── trackpoint.cpp ├── trackpoint.h ├── trail.png ├── ttbinreader.cpp ├── ttbinreader.h ├── ttmanager.cpp ├── ttmanager.h ├── ttwatch.cpp ├── ttwatch.h ├── ttwatcher.pro ├── ttwatcher.rc ├── version.h ├── watch_large.png ├── watch_small.png ├── watchexporters.cpp ├── watchexporters.h ├── workouttreemodel.cpp └── workouttreemodel.h /TTWatcherMain.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS+=ttwatcher 4 | SUBDIRS+=qhttpserver 5 | SUBDIRS+=quazip 6 | 7 | quazip.file = quazip/quazip/quazip.pro 8 | 9 | qhttpserver.file=qhttpserver/src/src.pro 10 | 11 | ttwatcher.file=src/ttwatcher.pro 12 | ttwatcher.depends += qhttpserver 13 | ttwatcher.depends += quazip 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/windows/x64/hid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/lib/windows/x64/hid.lib -------------------------------------------------------------------------------- /lib/windows/x86/hid.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/lib/windows/x86/hid.lib -------------------------------------------------------------------------------- /qhttpserver/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011-2014 Nikhil Marathe 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /qhttpserver/README.md: -------------------------------------------------------------------------------- 1 | QHttpServer 2 | =========== 3 | 4 | A Qt HTTP Server - because hard-core programmers write web-apps in C++ :) 5 | 6 | It uses Joyent's [HTTP Parser](http://github.com/joyent/http-parser) and is asynchronous and does not require any inheritance. 7 | 8 | QHttpServer is available under the MIT License. 9 | 10 | **NOTE: QHttpServer is NOT fully HTTP compliant right now! DO NOT use it for 11 | anything complex** 12 | 13 | Installation 14 | ------------ 15 | 16 | Requires Qt 4 or Qt 5. 17 | 18 | qmake && make && su -c 'make install' 19 | 20 | To link to your projects put this in your project's qmake project file 21 | 22 | LIBS += -lqhttpserver 23 | 24 | By default, the installation prefix is /usr/local. To change that to /usr, 25 | for example, run: 26 | 27 | qmake -r PREFIX=/usr 28 | 29 | Usage 30 | ----- 31 | 32 | Include the headers 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | Create a server, and connect to the signal for new requests 39 | 40 | QHttpServer *server = new QHttpServer; 41 | connect(server, SIGNAL(newRequest(QHttpRequest*, QHttpResponse*)), 42 | handler, SLOT(handle(QHttpRequest*, QHttpResponse*))); 43 | 44 | // let's go 45 | server->listen(8080); 46 | 47 | In the handler, you may dispatch on routes or do whatever other things 48 | you want. See the API documentation for what information 49 | is provided about the request via the QHttpRequest object. 50 | 51 | To send data back to the browser and end the request: 52 | 53 | void Handler::handle(QHttpRequest *req, QHttpResponse *resp) 54 | { 55 | resp->setHeader("Content-Length", 11); 56 | resp->writeHead(200); // everything is OK 57 | resp->write("Hello World"); 58 | resp->end(); 59 | } 60 | 61 | The server and request/response objects emit various signals 62 | and have guarantees about memory management. See the API documentation for 63 | these. 64 | 65 | Contribute 66 | ---------- 67 | 68 | Feel free to file issues, branch and send pull requests. If you plan to work on a major feature (say WebSocket support), please run it by me first by filing an issue! qhttpserver has a narrow scope and API and I'd like to keep it that way, so a thousand line patch that implements the kitchen sink is unlikely to be accepted. 69 | 70 | - Nikhil Marathe (maintainer) 71 | 72 | Everybody who has ever contributed shows up in [Contributors](https://github.com/nikhilm/qhttpserver/graphs/contributors). 73 | -------------------------------------------------------------------------------- /qhttpserver/TODO: -------------------------------------------------------------------------------- 1 | * Expect & Continue stuff 2 | * Chunked encoding support 3 | * Only copy over public headers etc. 4 | * connection object should connect to QHttpResponse::destroyed() 5 | and stop pushing data into it or whatever if the object is destroyed. 6 | * response object should keep track of emitting done() and not accept writes after that 7 | * handle encoding in response write and end 8 | -------------------------------------------------------------------------------- /qhttpserver/docs/pages/examples.dox: -------------------------------------------------------------------------------- 1 | /** 2 | 3 | @example helloworld/helloworld.cpp 4 | @example helloworld/helloworld.h 5 | @example greeting/greeting.cpp 6 | @example greeting/greeting.h 7 | @example bodydata/bodydata.cpp 8 | @example bodydata/bodydata.h 9 | 10 | */ -------------------------------------------------------------------------------- /qhttpserver/examples/bodydata/bodydata.cpp: -------------------------------------------------------------------------------- 1 | #include "bodydata.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | /// BodyData 13 | 14 | BodyData::BodyData() 15 | { 16 | QHttpServer *server = new QHttpServer(this); 17 | connect(server, SIGNAL(newRequest(QHttpRequest*, QHttpResponse*)), 18 | this, SLOT(handleRequest(QHttpRequest*, QHttpResponse*))); 19 | 20 | server->listen(QHostAddress::Any, 5000); 21 | } 22 | 23 | void BodyData::handleRequest(QHttpRequest *req, QHttpResponse *resp) 24 | { 25 | new Responder(req, resp); 26 | } 27 | 28 | /// Responder 29 | 30 | Responder::Responder(QHttpRequest *req, QHttpResponse *resp) 31 | : m_req(req) 32 | , m_resp(resp) 33 | { 34 | QRegExp exp("^/user/([a-z]+$)"); 35 | if (exp.indexIn(req->path()) == -1) 36 | { 37 | resp->writeHead(403); 38 | resp->end(QByteArray("You aren't allowed here!")); 39 | /// @todo There should be a way to tell request to stop streaming data 40 | return; 41 | } 42 | 43 | resp->setHeader("Content-Type", "text/html"); 44 | resp->writeHead(200); 45 | 46 | QString name = exp.capturedTexts()[1]; 47 | QString bodyStart = tr("BodyData App

Hello %1!

").arg(name); 48 | resp->write(bodyStart.toUtf8()); 49 | 50 | connect(req, SIGNAL(data(const QByteArray&)), this, SLOT(accumulate(const QByteArray&))); 51 | connect(req, SIGNAL(end()), this, SLOT(reply())); 52 | connect(m_resp, SIGNAL(done()), this, SLOT(deleteLater())); 53 | } 54 | 55 | Responder::~Responder() 56 | { 57 | } 58 | 59 | void Responder::accumulate(const QByteArray &data) 60 | { 61 | m_resp->write(data); 62 | } 63 | 64 | void Responder::reply() 65 | { 66 | m_resp->end(QByteArray("

")); 67 | } 68 | 69 | /// main 70 | 71 | int main(int argc, char **argv) 72 | { 73 | QCoreApplication app(argc, argv); 74 | BodyData bodydata; 75 | app.exec(); 76 | } 77 | -------------------------------------------------------------------------------- /qhttpserver/examples/bodydata/bodydata.h: -------------------------------------------------------------------------------- 1 | #include "qhttpserverfwd.h" 2 | 3 | #include 4 | #include 5 | 6 | /// BodyData 7 | 8 | class BodyData : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | BodyData(); 14 | 15 | private slots: 16 | void handleRequest(QHttpRequest *req, QHttpResponse *resp); 17 | }; 18 | 19 | /// Responder 20 | 21 | class Responder : public QObject 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | Responder(QHttpRequest *req, QHttpResponse *resp); 27 | ~Responder(); 28 | 29 | signals: 30 | void done(); 31 | 32 | private slots: 33 | void accumulate(const QByteArray &data); 34 | void reply(); 35 | 36 | private: 37 | QScopedPointer m_req; 38 | QHttpResponse *m_resp; 39 | }; 40 | -------------------------------------------------------------------------------- /qhttpserver/examples/bodydata/bodydata.pro: -------------------------------------------------------------------------------- 1 | TARGET = bodydata 2 | 3 | QT += network 4 | QT -= gui 5 | 6 | CONFIG += debug 7 | 8 | INCLUDEPATH += ../../src 9 | LIBS += -L../../lib 10 | 11 | win32 { 12 | debug: LIBS += -lqhttpserverd 13 | else: LIBS += -lqhttpserver 14 | } else { 15 | LIBS += -lqhttpserver 16 | } 17 | 18 | SOURCES = bodydata.cpp 19 | HEADERS = bodydata.h 20 | -------------------------------------------------------------------------------- /qhttpserver/examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += \ 3 | helloworld\ 4 | greeting\ 5 | bodydata\ 6 | -------------------------------------------------------------------------------- /qhttpserver/examples/greeting/greeting.cpp: -------------------------------------------------------------------------------- 1 | #include "greeting.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | /// Greeting 12 | 13 | Greeting::Greeting() 14 | { 15 | QHttpServer *server = new QHttpServer(this); 16 | connect(server, SIGNAL(newRequest(QHttpRequest*, QHttpResponse*)), 17 | this, SLOT(handleRequest(QHttpRequest*, QHttpResponse*))); 18 | 19 | server->listen(QHostAddress::Any, 8080); 20 | } 21 | 22 | void Greeting::handleRequest(QHttpRequest *req, QHttpResponse *resp) 23 | { 24 | QRegExp exp("^/user/([a-z]+)$"); 25 | if( exp.indexIn(req->path()) != -1 ) 26 | { 27 | resp->setHeader("Content-Type", "text/html"); 28 | resp->writeHead(200); 29 | 30 | QString name = exp.capturedTexts()[1]; 31 | QString body = tr("Greeting App

Hello %1!

"); 32 | resp->end(body.arg(name).toUtf8()); 33 | } 34 | else 35 | { 36 | resp->writeHead(403); 37 | resp->end(QByteArray("You aren't allowed here!")); 38 | } 39 | } 40 | 41 | /// main 42 | 43 | int main(int argc, char **argv) 44 | { 45 | QCoreApplication app(argc, argv); 46 | Greeting greeting; 47 | app.exec(); 48 | } 49 | -------------------------------------------------------------------------------- /qhttpserver/examples/greeting/greeting.h: -------------------------------------------------------------------------------- 1 | #include "qhttpserverfwd.h" 2 | 3 | #include 4 | 5 | /// Greeting 6 | 7 | class Greeting : public QObject 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | Greeting(); 13 | 14 | private slots: 15 | void handleRequest(QHttpRequest *req, QHttpResponse *resp); 16 | }; 17 | -------------------------------------------------------------------------------- /qhttpserver/examples/greeting/greeting.pro: -------------------------------------------------------------------------------- 1 | TARGET = greeting 2 | 3 | QT += network 4 | QT -= gui 5 | 6 | CONFIG += debug 7 | 8 | INCLUDEPATH += ../../src 9 | LIBS += -L../../lib 10 | 11 | win32 { 12 | debug: LIBS += -lqhttpserverd 13 | else: LIBS += -lqhttpserver 14 | } else { 15 | LIBS += -lqhttpserver 16 | } 17 | 18 | SOURCES = greeting.cpp 19 | HEADERS = greeting.h 20 | -------------------------------------------------------------------------------- /qhttpserver/examples/helloworld/helloworld.cpp: -------------------------------------------------------------------------------- 1 | #include "helloworld.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | /// HelloWorld 10 | 11 | HelloWorld::HelloWorld() 12 | { 13 | QHttpServer *server = new QHttpServer(this); 14 | connect(server, SIGNAL(newRequest(QHttpRequest*, QHttpResponse*)), 15 | this, SLOT(handleRequest(QHttpRequest*, QHttpResponse*))); 16 | 17 | server->listen(QHostAddress::Any, 8080); 18 | } 19 | 20 | void HelloWorld::handleRequest(QHttpRequest *req, QHttpResponse *resp) 21 | { 22 | Q_UNUSED(req); 23 | 24 | QByteArray body = "Hello World"; 25 | resp->setHeader("Content-Length", QString::number(body.size())); 26 | resp->writeHead(200); 27 | resp->end(body); 28 | } 29 | 30 | /// main 31 | 32 | int main(int argc, char **argv) 33 | { 34 | QCoreApplication app(argc, argv); 35 | HelloWorld hello; 36 | app.exec(); 37 | } 38 | -------------------------------------------------------------------------------- /qhttpserver/examples/helloworld/helloworld.h: -------------------------------------------------------------------------------- 1 | #include "qhttpserverfwd.h" 2 | 3 | #include 4 | 5 | /// HelloWorld 6 | 7 | class HelloWorld : public QObject 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | HelloWorld(); 13 | 14 | private slots: 15 | void handleRequest(QHttpRequest *req, QHttpResponse *resp); 16 | }; 17 | -------------------------------------------------------------------------------- /qhttpserver/examples/helloworld/helloworld.pro: -------------------------------------------------------------------------------- 1 | TARGET = helloworld 2 | 3 | QT += network 4 | QT -= gui 5 | 6 | CONFIG += debug 7 | 8 | INCLUDEPATH += ../../src 9 | LIBS += -L../../lib 10 | 11 | win32 { 12 | debug: LIBS += -lqhttpserverd 13 | else: LIBS += -lqhttpserver 14 | } else { 15 | LIBS += -lqhttpserver 16 | } 17 | 18 | SOURCES = helloworld.cpp 19 | HEADERS = helloworld.h 20 | -------------------------------------------------------------------------------- /qhttpserver/http-parser/.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | *.o 3 | test 4 | test_g 5 | -------------------------------------------------------------------------------- /qhttpserver/http-parser/AUTHORS: -------------------------------------------------------------------------------- 1 | # Authors ordered by first contribution. 2 | Ryan Dahl 3 | Jeremy Hinegardner 4 | Sergey Shepelev 5 | Joe Damato 6 | tomika 7 | Phoenix Sol 8 | Cliff Frey 9 | Ewen Cheslack-Postava 10 | Santiago Gala 11 | Tim Becker 12 | Jeff Terrace 13 | Ben Noordhuis 14 | Nathan Rajlich 15 | Mark Nottingham 16 | Aman Gupta 17 | Tim Becker 18 | Sean Cunningham 19 | Peter Griess 20 | Salman Haq 21 | Cliff Frey 22 | Jon Kolb 23 | Fouad Mardini 24 | Paul Querna 25 | Felix Geisendörfer 26 | koichik 27 | Andre Caron 28 | Ivo Raisr 29 | James McLaughlin 30 | David Gwynne 31 | LE ROUX Thomas 32 | Randy Rizun 33 | Andre Louis Caron 34 | Simon Zimmermann 35 | Erik Dubbelboer 36 | Martell Malone 37 | Bertrand Paquet 38 | BogDan Vatra 39 | Peter Faiman 40 | Corey Richardson 41 | -------------------------------------------------------------------------------- /qhttpserver/http-parser/CONTRIBUTIONS: -------------------------------------------------------------------------------- 1 | Contributors must agree to the Contributor License Agreement before patches 2 | can be accepted. 3 | 4 | http://spreadsheets2.google.com/viewform?hl=en&formkey=dDJXOGUwbzlYaWM4cHN1MERwQS1CSnc6MQ 5 | -------------------------------------------------------------------------------- /qhttpserver/http-parser/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright 2 | Igor Sysoev. 3 | 4 | Additional changes are licensed under the same terms as NGINX and 5 | copyright Joyent, Inc. and other Node contributors. All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to 9 | deal in the Software without restriction, including without limitation the 10 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11 | sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23 | IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /qhttpserver/http-parser/url_parser.c: -------------------------------------------------------------------------------- 1 | #include "http_parser.h" 2 | #include 3 | #include 4 | 5 | void 6 | dump_url (const char *url, const struct http_parser_url *u) 7 | { 8 | unsigned int i; 9 | 10 | printf("\tfield_set: 0x%x, port: %u\n", u->field_set, u->port); 11 | for (i = 0; i < UF_MAX; i++) { 12 | if ((u->field_set & (1 << i)) == 0) { 13 | printf("\tfield_data[%u]: unset\n", i); 14 | continue; 15 | } 16 | 17 | printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n", 18 | i, 19 | u->field_data[i].off, 20 | u->field_data[i].len, 21 | u->field_data[i].len, 22 | url + u->field_data[i].off); 23 | } 24 | } 25 | 26 | int main(int argc, char ** argv) { 27 | if (argc != 3) { 28 | printf("Syntax : %s connect|get url\n", argv[0]); 29 | return 1; 30 | } 31 | struct http_parser_url u; 32 | int len = strlen(argv[2]); 33 | int connect = strcmp("connect", argv[1]) == 0 ? 1 : 0; 34 | printf("Parsing %s, connect %d\n", argv[2], connect); 35 | 36 | int result = http_parser_parse_url(argv[2], len, connect, &u); 37 | if (result != 0) { 38 | printf("Parse error : %d\n", result); 39 | return result; 40 | } 41 | printf("Parse ok, result : \n"); 42 | dump_url(argv[2], &u); 43 | return 0; 44 | } -------------------------------------------------------------------------------- /qhttpserver/qhttpserver.pri: -------------------------------------------------------------------------------- 1 | isEmpty(PREFIX):PREFIX = /usr/local 2 | isEmpty(LIBDIR):LIBDIR = $${PREFIX}/lib 3 | isEmpty(INCLUDEDIR):INCLUDEDIR = $${PREFIX}/include 4 | -------------------------------------------------------------------------------- /qhttpserver/qhttpserver.pro: -------------------------------------------------------------------------------- 1 | CONFIG += ordered 2 | 3 | TEMPLATE = subdirs 4 | 5 | SUBDIRS += src \ 6 | examples 7 | 8 | examples.depends = src 9 | -------------------------------------------------------------------------------- /qhttpserver/src/qhttpserverapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2014 Nikhil Marathe 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef Q_HTTP_SERVER_API 24 | #define Q_HTTP_SERVER_API 25 | 26 | #include 27 | 28 | #ifndef Q_HTTP_STATIC_BUILD 29 | 30 | #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 31 | #ifdef Q_OS_WIN 32 | // Define to export or import depending if we are building or using the library. 33 | // QHTTPSERVER_EXPORT should only be defined when building. 34 | #if defined(QHTTPSERVER_EXPORT) 35 | #define QHTTPSERVER_API __declspec(dllexport) 36 | #else 37 | #define QHTTPSERVER_API __declspec(dllimport) 38 | #endif 39 | #else 40 | // Define empty for other platforms 41 | #define QHTTPSERVER_API 42 | #endif 43 | #else 44 | #ifdef Q_WS_WIN 45 | // Define to export or import depending if we are building or using the library. 46 | // QHTTPSERVER_EXPORT should only be defined when building. 47 | #if defined(QHTTPSERVER_EXPORT) 48 | #define QHTTPSERVER_API __declspec(dllexport) 49 | #else 50 | #define QHTTPSERVER_API __declspec(dllimport) 51 | #endif 52 | #else 53 | // Define empty for other platforms 54 | #define QHTTPSERVER_API 55 | #endif 56 | #endif 57 | 58 | #else // Q_HTTP_STATIC_BUILD 59 | 60 | #define QHTTPSERVER_API 61 | 62 | #endif // Q_HTTP_STATIC_BUILD 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /qhttpserver/src/qhttpserverfwd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2014 Nikhil Marathe 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to 6 | * deal in the Software without restriction, including without limitation the 7 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | * sell copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | * IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef Q_HTTP_SERVER_FWD 24 | #define Q_HTTP_SERVER_FWD 25 | 26 | #include 27 | #include 28 | 29 | /*! 30 | * A map of request or response headers 31 | */ 32 | typedef QHash HeaderHash; 33 | 34 | // QHttpServer 35 | class QHttpServer; 36 | class QHttpConnection; 37 | class QHttpRequest; 38 | class QHttpResponse; 39 | 40 | // Qt 41 | class QTcpServer; 42 | class QTcpSocket; 43 | 44 | // http_parser 45 | struct http_parser_settings; 46 | struct http_parser; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /qhttpserver/src/src.pro: -------------------------------------------------------------------------------- 1 | include(../qhttpserver.pri) 2 | 3 | QHTTPSERVER_BASE = .. 4 | TEMPLATE = lib 5 | 6 | TARGET = qhttpserver 7 | 8 | !win32:VERSION = 0.1.0 9 | 10 | QT += network 11 | QT -= gui 12 | 13 | CONFIG += dll debug_and_release 14 | CONFIG += staticlib 15 | DEFINES += Q_HTTP_STATIC_BUILD 16 | 17 | DEFINES += QHTTPSERVER_EXPORT 18 | 19 | INCLUDEPATH += $$QHTTPSERVER_BASE/http-parser 20 | 21 | PRIVATE_HEADERS += $$QHTTPSERVER_BASE/http-parser/http_parser.h qhttpconnection.h 22 | 23 | PUBLIC_HEADERS += qhttpserver.h qhttprequest.h qhttpresponse.h qhttpserverapi.h qhttpserverfwd.h 24 | 25 | HEADERS = $$PRIVATE_HEADERS $$PUBLIC_HEADERS 26 | SOURCES = *.cpp $$QHTTPSERVER_BASE/http-parser/http_parser.c 27 | 28 | #OBJECTS_DIR = $$QHTTPSERVER_BASE/build 29 | #MOC_DIR = $$QHTTPSERVER_BASE/build 30 | #DESTDIR = $$QHTTPSERVER_BASE/lib 31 | 32 | target.path = $$LIBDIR 33 | headers.path = $$INCLUDEDIR 34 | headers.files = $$PUBLIC_HEADERS 35 | INSTALLS += target headers 36 | -------------------------------------------------------------------------------- /quazip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project (QuaZip) 2 | cmake_minimum_required(VERSION 2.6) 3 | 4 | option(BUILD_WITH_QT4 "Build QuaZip with Qt4 no matter if Qt5 was found" OFF) 5 | 6 | if( NOT BUILD_WITH_QT4 ) 7 | # try Qt5 first, and prefer that if found 8 | find_package(Qt5Core QUIET) 9 | endif() 10 | 11 | if (Qt5Core_FOUND) 12 | set(QTCORE_LIBRARIES ${Qt5Core_LIBRARIES}) 13 | # if there is no QT_ROOT, try to deduce it from Qt QtCore include 14 | if ("${QT_ROOT}" STREQUAL "") 15 | set(QT_ROOT ${QT_QTCORE_INCLUDE_DIR}/../..) 16 | endif() 17 | include_directories(${Qt5Core_INCLUDE_DIRS}) 18 | 19 | macro(qt_wrap_cpp) 20 | qt5_wrap_cpp(${ARGN}) 21 | endmacro() 22 | else() 23 | set(qt_min_version "4.5.0") 24 | find_package(Qt4 REQUIRED) 25 | set(QT_USE_QTGUI false) 26 | include(${QT_USE_FILE}) 27 | include_directories(${QT_INCLUDES}) 28 | set(QTCORE_LIBRARIES ${QT_QTCORE_LIBRARY}) 29 | 30 | macro(qt_wrap_cpp) 31 | qt4_wrap_cpp(${ARGN}) 32 | endmacro() 33 | endif() 34 | 35 | # Use system zlib on unix and Qt ZLIB on Windows 36 | IF(UNIX) 37 | find_package(ZLIB REQUIRED) 38 | ELSE(UNIX) 39 | SET(ZLIB_INCLUDE_DIRS "${QT_ROOT}/src/3rdparty/zlib" CACHE STRING "Path to ZLIB headers of Qt") 40 | SET(ZLIB_LIBRARIES "") 41 | IF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") 42 | MESSAGE("Please specify a valid zlib include dir") 43 | ENDIF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") 44 | ENDIF(UNIX) 45 | 46 | # All build libraries are moved to this directory 47 | SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) 48 | 49 | set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)") 50 | set(LIB_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Library directory name" FORCE) 51 | 52 | add_subdirectory(quazip) 53 | 54 | install(FILES FindQuaZip.cmake DESTINATION ${CMAKE_ROOT}/Modules) 55 | -------------------------------------------------------------------------------- /quazip/FindQuaZip.cmake: -------------------------------------------------------------------------------- 1 | # QUAZIP_FOUND - QuaZip library was found 2 | # QUAZIP_INCLUDE_DIR - Path to QuaZip include dir 3 | # QUAZIP_INCLUDE_DIRS - Path to QuaZip and zlib include dir (combined from QUAZIP_INCLUDE_DIR + ZLIB_INCLUDE_DIR) 4 | # QUAZIP_LIBRARIES - List of QuaZip libraries 5 | # QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers 6 | 7 | 8 | IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) 9 | # in cache already 10 | SET(QUAZIP_FOUND TRUE) 11 | ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) 12 | IF (WIN32) 13 | FIND_PATH(QUAZIP_LIBRARY_DIR 14 | WIN32_DEBUG_POSTFIX d 15 | NAMES libquazip.dll 16 | HINTS "C:/Programme/" "C:/Program Files" 17 | PATH_SUFFIXES QuaZip/lib 18 | ) 19 | FIND_LIBRARY(QUAZIP_LIBRARIES NAMES libquazip.dll HINTS ${QUAZIP_LIBRARY_DIR}) 20 | FIND_PATH(QUAZIP_INCLUDE_DIR NAMES quazip.h HINTS ${QUAZIP_LIBRARY_DIR}/../ PATH_SUFFIXES include/quazip) 21 | FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR NAMES zlib.h) 22 | ELSE(WIN32) 23 | FIND_PACKAGE(PkgConfig) 24 | # pkg_check_modules(PC_QCA2 QUIET qca2) 25 | pkg_check_modules(PC_QUAZIP quazip) 26 | FIND_LIBRARY(QUAZIP_LIBRARIES 27 | WIN32_DEBUG_POSTFIX d 28 | NAMES quazip 29 | HINTS /usr/lib /usr/lib64 30 | ) 31 | FIND_PATH(QUAZIP_INCLUDE_DIR quazip.h 32 | HINTS /usr/include /usr/local/include 33 | PATH_SUFFIXES quazip 34 | ) 35 | FIND_PATH(QUAZIP_ZLIB_INCLUDE_DIR zlib.h HINTS /usr/include /usr/local/include) 36 | ENDIF (WIN32) 37 | INCLUDE(FindPackageHandleStandardArgs) 38 | SET(QUAZIP_INCLUDE_DIRS ${QUAZIP_INCLUDE_DIR} ${QUAZIP_ZLIB_INCLUDE_DIR}) 39 | find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_LIBRARIES QUAZIP_INCLUDE_DIR QUAZIP_ZLIB_INCLUDE_DIR QUAZIP_INCLUDE_DIRS) 40 | ENDIF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) 41 | -------------------------------------------------------------------------------- /quazip/README.txt: -------------------------------------------------------------------------------- 1 | QuaZIP is the C++ wrapper for Gilles Vollant's ZIP/UNZIP package 2 | (AKA minizip) using Trolltech's Qt library. 3 | 4 | It uses existing ZIP/UNZIP package C code and therefore depends on 5 | the zlib library. 6 | 7 | Also, it depends on Qt 4. 8 | 9 | To compile it on UNIX dialect: 10 | 11 | $ cd quazip 12 | $ qmake 13 | $ make 14 | 15 | You must make sure that: 16 | * You have Qt 4 properly and fully installed (including tools and 17 | headers, not just library) 18 | * "qmake" command runs Qt 4's qmake, not some other version (you'll have 19 | to type full path to qmake otherwise). 20 | 21 | To install compiled shared library, just type: 22 | 23 | $ make install 24 | 25 | By default, it installs in /usr/local, but you may change it using 26 | 27 | $ qmake PREFIX=/wherever/you/want/to/install 28 | 29 | You do not have to compile and install QuaZIP to use it. You can just 30 | (and sometimes it may be the best way) add QuaZIP's source files to your 31 | project and use them. 32 | 33 | See doc/html or, if you do not have a browser, quazip/*.h and 34 | quazip/doc/* files for the more detailed documentation. 35 | 36 | For Windows, it's essentially the same, but you may have to adjust 37 | settings for different environments. 38 | 39 | If you want to include QuaZIP sources directly in your project or if 40 | you want to use QuaZIP compiled as a static library using 41 | "qmake CONFIG+=statliclib", you have to define the QUAZIP_STATIC macro, 42 | otherwise you're likely to run into problems as QuaZIP symbols will be 43 | marked as dllimported. 44 | 45 | Copyright notice: 46 | 47 | Copyright (C) 2005-2012 Sergey A. Tachenov 48 | 49 | This program is free software; you can redistribute it and/or modify it 50 | under the terms of the GNU Lesser General Public License as published by 51 | the Free Software Foundation; either version 2 of the License, or (at 52 | your option) any later version. 53 | 54 | This program is distributed in the hope that it will be useful, but 55 | WITHOUT ANY WARRANTY; without even the implied warranty of 56 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 57 | General Public License for more details. 58 | 59 | You should have received a copy of the GNU Lesser General Public License 60 | along with this program; if not, write to the Free Software Foundation, 61 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 62 | 63 | See COPYING file for the full LGPL text. 64 | 65 | Original ZIP package is copyrighted by Gilles Vollant, see 66 | quazip/(un)zip.h files for details, basically it's zlib license. 67 | -------------------------------------------------------------------------------- /quazip/doc/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/bc_s.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaAdler32__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaAdler32__coll__graph.md5: -------------------------------------------------------------------------------- 1 | f6aef7d7bad2a6a2c0f29520e9cdb67f -------------------------------------------------------------------------------- /quazip/doc/html/classQuaAdler32__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaAdler32__coll__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaAdler32__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaAdler32__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | f6aef7d7bad2a6a2c0f29520e9cdb67f -------------------------------------------------------------------------------- /quazip/doc/html/classQuaAdler32__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaAdler32__inherit__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaChecksum32__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaChecksum32__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 84ec9abb25cc3d010952b190062cd40b -------------------------------------------------------------------------------- /quazip/doc/html/classQuaChecksum32__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaChecksum32__inherit__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaCrc32__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaCrc32__coll__graph.md5: -------------------------------------------------------------------------------- 1 | c5893d01f9e8b7b19610a8cce32f67e4 -------------------------------------------------------------------------------- /quazip/doc/html/classQuaCrc32__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaCrc32__coll__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaCrc32__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaCrc32__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | c5893d01f9e8b7b19610a8cce32f67e4 -------------------------------------------------------------------------------- /quazip/doc/html/classQuaCrc32__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaCrc32__inherit__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFilePrivate-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QuaZIP: Member List 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 19 | 20 | 21 |
17 |
QuaZIP quazip-0-7-1
18 |
22 |
23 | 32 | 39 |
40 |
41 |
42 |
QuaZipFilePrivate Member List
43 |
44 |
45 | This is the complete list of members for QuaZipFilePrivate, including all inherited members. 46 | 47 |
QuaZipFile (defined in QuaZipFilePrivate)QuaZipFilePrivate [friend]
48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFilePrivate__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFilePrivate__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 8d67fd832bb90332fedcba49da020a67 -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFilePrivate__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaZipFilePrivate__coll__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFile__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFile__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 3cca548c6e61503dea7d82da54af1f8a -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipFile__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaZipFile__coll__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipPrivate__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipPrivate__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 4dadbc94c10e818b6d044a538076a620 -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZipPrivate__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaZipPrivate__coll__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZip__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZip__coll__graph.md5: -------------------------------------------------------------------------------- 1 | d04fc6b476641932472c86fd8096968c -------------------------------------------------------------------------------- /quazip/doc/html/classQuaZip__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/classQuaZip__coll__graph.png -------------------------------------------------------------------------------- /quazip/doc/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/closed.png -------------------------------------------------------------------------------- /quazip/doc/html/deprecated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QuaZIP: Deprecated List 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 19 | 20 | 21 |
17 |
QuaZIP quazip-0-7-1
18 |
22 |
23 | 32 |
33 |
34 |
35 |
Deprecated List
36 |
37 |
38 |

39 |
40 |
Class QuaZipFileInfo
41 |
Use QuaZipFileInfo64 instead. Not only it supports large files, but also more convenience methods as well.
42 |
43 |
44 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /quazip/doc/html/dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.md5: -------------------------------------------------------------------------------- 1 | be1b21301b4c2eeec676c114c3df2fa2 -------------------------------------------------------------------------------- /quazip/doc/html/dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.png -------------------------------------------------------------------------------- /quazip/doc/html/dirs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QuaZIP: Directories 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 19 | 20 | 21 |
17 |
QuaZIP quazip-0-7-1
18 |
22 |
23 | 32 |
33 |
34 |
35 |
Directories
36 |
37 |
38 |
This directory hierarchy is sorted roughly, but not completely, alphabetically:
41 |
42 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /quazip/doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/doxygen.png -------------------------------------------------------------------------------- /quazip/doc/html/graph_legend.md5: -------------------------------------------------------------------------------- 1 | 9fbb782f23f919c0064b8f454a56ede8 -------------------------------------------------------------------------------- /quazip/doc/html/graph_legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/graph_legend.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_0.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_0.md5: -------------------------------------------------------------------------------- 1 | 87c0f0d7a3432462cbd094e7c615e18e -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_0.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_1.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_1.md5: -------------------------------------------------------------------------------- 1 | ee3f1811697d65a8dd95078cb65e0d8f -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_1.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_10.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_10.md5: -------------------------------------------------------------------------------- 1 | bb506805d0a0a557d4ccbc22245703be -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_10.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_11.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_11.md5: -------------------------------------------------------------------------------- 1 | 2fed9c540a17c647243104aeda47c683 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_11.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_12.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_12.md5: -------------------------------------------------------------------------------- 1 | 8e1c8bc28a8271d22c62e3355c4d6457 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_12.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_2.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_2.md5: -------------------------------------------------------------------------------- 1 | 521dc5609a23895b8a3757ffc576f343 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_2.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_3.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_3.md5: -------------------------------------------------------------------------------- 1 | 08d70385c6cb46b3e468c025be58be29 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_3.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_4.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_4.md5: -------------------------------------------------------------------------------- 1 | b61cc9a124a015d73d6cbdf422313db4 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_4.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_5.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_5.md5: -------------------------------------------------------------------------------- 1 | 516630e9457f1fceabe81e76fdbf113d -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_5.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_6.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_6.md5: -------------------------------------------------------------------------------- 1 | c70793a20c0ee967fcd21a549a42a789 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_6.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_7.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_7.md5: -------------------------------------------------------------------------------- 1 | a304fc926447a90879a7cd82c1947d0c -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_7.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_8.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_8.md5: -------------------------------------------------------------------------------- 1 | bb94f8389c69fe5653003491edaa81cb -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_8.png -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_9.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_9.md5: -------------------------------------------------------------------------------- 1 | 5bb5840bebb562b49d7b50f9856f62d8 -------------------------------------------------------------------------------- /quazip/doc/html/inherit_graph_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/inherit_graph_9.png -------------------------------------------------------------------------------- /quazip/doc/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/nav_f.png -------------------------------------------------------------------------------- /quazip/doc/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/nav_h.png -------------------------------------------------------------------------------- /quazip/doc/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/open.png -------------------------------------------------------------------------------- /quazip/doc/html/pages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QuaZIP: Related Pages 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 19 | 20 | 21 |
17 |
QuaZIP quazip-0-7-1
18 |
22 |
23 | 32 |
33 |
34 |
35 |
Related Pages
36 |
37 |
38 |
Here is a list of all related documentation pages:
46 |
47 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /quazip/doc/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/tab_a.png -------------------------------------------------------------------------------- /quazip/doc/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/tab_b.png -------------------------------------------------------------------------------- /quazip/doc/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/tab_h.png -------------------------------------------------------------------------------- /quazip/doc/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/quazip/doc/html/tab_s.png -------------------------------------------------------------------------------- /quazip/doc/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | } 7 | 8 | .tabs2 { 9 | font-size: 10px; 10 | } 11 | .tabs3 { 12 | font-size: 9px; 13 | } 14 | 15 | .tablist { 16 | margin: 0; 17 | padding: 0; 18 | display: table; 19 | } 20 | 21 | .tablist li { 22 | float: left; 23 | display: table-cell; 24 | background-image: url('tab_b.png'); 25 | line-height: 36px; 26 | list-style: none; 27 | } 28 | 29 | .tablist a { 30 | display: block; 31 | padding: 0 20px; 32 | font-weight: bold; 33 | background-image:url('tab_s.png'); 34 | background-repeat:no-repeat; 35 | background-position:right; 36 | color: #283A5D; 37 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 38 | text-decoration: none; 39 | outline: none; 40 | } 41 | 42 | .tabs3 .tablist a { 43 | padding: 0 10px; 44 | } 45 | 46 | .tablist a:hover { 47 | background-image: url('tab_h.png'); 48 | background-repeat:repeat-x; 49 | color: #fff; 50 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 51 | text-decoration: none; 52 | } 53 | 54 | .tablist li.current a { 55 | background-image: url('tab_a.png'); 56 | background-repeat:repeat-x; 57 | color: #fff; 58 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 59 | } 60 | -------------------------------------------------------------------------------- /quazip/doc/latex/Makefile: -------------------------------------------------------------------------------- 1 | all: refman.dvi 2 | 3 | ps: refman.ps 4 | 5 | pdf: refman.pdf 6 | 7 | ps_2on1: refman_2on1.ps 8 | 9 | pdf_2on1: refman_2on1.pdf 10 | 11 | refman.ps: refman.dvi 12 | dvips -o refman.ps refman.dvi 13 | 14 | refman.pdf: refman.ps 15 | gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman.pdf -c save pop -f refman.ps 16 | 17 | refman.dvi: clean refman.tex doxygen.sty 18 | echo "Running latex..." 19 | latex refman.tex 20 | echo "Running makeindex..." 21 | makeindex refman.idx 22 | echo "Rerunning latex...." 23 | latex refman.tex 24 | latex_count=5 ; \ 25 | while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ 26 | do \ 27 | echo "Rerunning latex...." ;\ 28 | latex refman.tex ;\ 29 | latex_count=`expr $$latex_count - 1` ;\ 30 | done 31 | 32 | refman_2on1.ps: refman.ps 33 | psnup -2 refman.ps >refman_2on1.ps 34 | 35 | refman_2on1.pdf: refman_2on1.ps 36 | gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman_2on1.pdf -c save pop -f refman_2on1.ps 37 | 38 | clean: 39 | del /s/y *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf 40 | -------------------------------------------------------------------------------- /quazip/doc/latex/annotated.tex: -------------------------------------------------------------------------------- 1 | \section{Class List} 2 | Here are the classes, structs, unions and interfaces with brief descriptions:\begin{DoxyCompactList} 3 | \item\contentsline{section}{{\bf JlCompress} (Utility class for typical operations )}{\pageref{classJlCompress}}{} 4 | \item\contentsline{section}{{\bf QIODevice\_\-descriptor} }{\pageref{structQIODevice__descriptor}}{} 5 | \item\contentsline{section}{{\bf QuaAdler32} (Adler32 checksum )}{\pageref{classQuaAdler32}}{} 6 | \item\contentsline{section}{{\bf QuaChecksum32} (Checksum interface )}{\pageref{classQuaChecksum32}}{} 7 | \item\contentsline{section}{{\bf QuaCrc32} (CRC32 checksum )}{\pageref{classQuaCrc32}}{} 8 | \item\contentsline{section}{{\bf QuaGzipFile} (GZIP file )}{\pageref{classQuaGzipFile}}{} 9 | \item\contentsline{section}{{\bf QuaZIODevice} (A class to compress/decompress QIODevice )}{\pageref{classQuaZIODevice}}{} 10 | \item\contentsline{section}{{\bf QuaZip} (ZIP archive )}{\pageref{classQuaZip}}{} 11 | \item\contentsline{section}{{\bf QuaZipDir} (Provides ZIP archive navigation )}{\pageref{classQuaZipDir}}{} 12 | \item\contentsline{section}{{\bf QuaZipFile} (A file inside ZIP archive )}{\pageref{classQuaZipFile}}{} 13 | \item\contentsline{section}{{\bf QuaZipFileInfo} (Information about a file inside archive )}{\pageref{structQuaZipFileInfo}}{} 14 | \item\contentsline{section}{{\bf QuaZipFileInfo64} (Information about a file inside archive (with zip64 support) )}{\pageref{structQuaZipFileInfo64}}{} 15 | \item\contentsline{section}{{\bf QuaZipFilePrivate} (The implementation class for \doxyref{QuaZip}{p.}{classQuaZip} )}{\pageref{classQuaZipFilePrivate}}{} 16 | \item\contentsline{section}{{\bf QuaZipNewInfo} (Information about a file to be created )}{\pageref{structQuaZipNewInfo}}{} 17 | \item\contentsline{section}{{\bf QuaZipPrivate} (All the internal stuff for the \doxyref{QuaZip}{p.}{classQuaZip} class )}{\pageref{classQuaZipPrivate}}{} 18 | \end{DoxyCompactList} 19 | -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaAdler32__coll__graph.md5: -------------------------------------------------------------------------------- 1 | dbe414b63f5eac72ebd22d72dbae868f -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaAdler32__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | dbe414b63f5eac72ebd22d72dbae868f -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaChecksum32__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | fe6eaf22d351a7125f230bf0b6ba2704 -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaCrc32__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 494c6ee53c032c90c71e084fc73592f9 -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaCrc32__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 494c6ee53c032c90c71e084fc73592f9 -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaZipFilePrivate.tex: -------------------------------------------------------------------------------- 1 | \section{QuaZipFilePrivate Class Reference} 2 | \label{classQuaZipFilePrivate}\index{QuaZipFilePrivate@{QuaZipFilePrivate}} 3 | 4 | 5 | The implementation class for \doxyref{QuaZip}{p.}{classQuaZip}. 6 | 7 | 8 | 9 | 10 | Collaboration diagram for QuaZipFilePrivate: 11 | \nopagebreak 12 | \begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[width=231pt]{classQuaZipFilePrivate__coll__graph} 16 | \end{center} 17 | \end{figure} 18 | \subsection*{Friends} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | class {\bf QuaZipFile}\label{classQuaZipFilePrivate_a40bd4ccb6d2d00726e1de81329ebaa7a} 22 | 23 | \end{DoxyCompactItemize} 24 | 25 | 26 | \subsection{Detailed Description} 27 | The implementation class for \doxyref{QuaZip}{p.}{classQuaZip}. 28 | 29 | The documentation for this class was generated from the following file:\begin{DoxyCompactItemize} 30 | \item 31 | quazip/quazipfile.cpp\end{DoxyCompactItemize} 32 | -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaZipFilePrivate__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 1f8ac6d56acdc49496bc99c52404e6a3 -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaZipFile__coll__graph.md5: -------------------------------------------------------------------------------- 1 | d4c12e105f1f89650e643227b7eb6b67 -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaZipPrivate.tex: -------------------------------------------------------------------------------- 1 | \section{QuaZipPrivate Class Reference} 2 | \label{classQuaZipPrivate}\index{QuaZipPrivate@{QuaZipPrivate}} 3 | 4 | 5 | All the internal stuff for the \doxyref{QuaZip}{p.}{classQuaZip} class. 6 | 7 | 8 | 9 | 10 | Collaboration diagram for QuaZipPrivate: 11 | \nopagebreak 12 | \begin{figure}[H] 13 | \begin{center} 14 | \leavevmode 15 | \includegraphics[width=120pt]{classQuaZipPrivate__coll__graph} 16 | \end{center} 17 | \end{figure} 18 | \subsection*{Friends} 19 | \begin{DoxyCompactItemize} 20 | \item 21 | class {\bf QuaZip}\label{classQuaZipPrivate_a913fb7bbd3527119ebb8052d57132af2} 22 | 23 | \end{DoxyCompactItemize} 24 | 25 | 26 | \subsection{Detailed Description} 27 | All the internal stuff for the \doxyref{QuaZip}{p.}{classQuaZip} class. 28 | 29 | The documentation for this class was generated from the following file:\begin{DoxyCompactItemize} 30 | \item 31 | quazip/quazip.cpp\end{DoxyCompactItemize} 32 | -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaZipPrivate__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 03e89dfdd147054460a64a46c1bdc9c2 -------------------------------------------------------------------------------- /quazip/doc/latex/classQuaZip__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 285ae05030356ab7fd5c5be4e423dbb5 -------------------------------------------------------------------------------- /quazip/doc/latex/deprecated.tex: -------------------------------------------------------------------------------- 1 | \label{deprecated__deprecated000001} 2 | 3 | \begin{DoxyDescription} 4 | \item[Class \doxyref{QuaZipFileInfo}{p.}{structQuaZipFileInfo} ]Use \doxyref{QuaZipFileInfo64}{p.}{structQuaZipFileInfo64} instead. Not only it supports large files, but also more convenience methods as well. 5 | \end{DoxyDescription} -------------------------------------------------------------------------------- /quazip/doc/latex/dir_cbf6adc56048bbbfc8f6af7fd7d57800.tex: -------------------------------------------------------------------------------- 1 | \section{quazip/ Directory Reference} 2 | \label{dir_cbf6adc56048bbbfc8f6af7fd7d57800}\index{quazip/ Directory Reference@{quazip/ Directory Reference}} 3 | Directory dependency graph for quazip/: 4 | \nopagebreak 5 | \begin{figure}[H] 6 | \begin{center} 7 | \leavevmode 8 | \includegraphics[width=98pt]{dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep} 9 | \end{center} 10 | \end{figure} 11 | \subsection*{Files} 12 | \begin{DoxyCompactItemize} 13 | \item 14 | file {\bfseries JlCompress.cpp} 15 | \item 16 | file {\bfseries JlCompress.h} 17 | \item 18 | file {\bfseries qioapi.cpp} 19 | \item 20 | file {\bfseries quaadler32.cpp} 21 | \item 22 | file {\bfseries quaadler32.h} 23 | \item 24 | file {\bfseries quachecksum32.h} 25 | \item 26 | file {\bfseries quacrc32.cpp} 27 | \item 28 | file {\bfseries quacrc32.h} 29 | \item 30 | file {\bfseries quagzipfile.cpp} 31 | \item 32 | file {\bfseries quagzipfile.h} 33 | \item 34 | file {\bfseries quaziodevice.cpp} 35 | \item 36 | file {\bfseries quaziodevice.h} 37 | \item 38 | file {\bfseries quazip.cpp} 39 | \item 40 | file {\bfseries quazip.h} 41 | \item 42 | file {\bfseries quazip\_\-global.h} 43 | \item 44 | file {\bfseries quazipdir.cpp} 45 | \item 46 | file {\bfseries quazipdir.h} 47 | \item 48 | file {\bfseries quazipfile.cpp} 49 | \item 50 | file {\bfseries quazipfile.h} 51 | \item 52 | file {\bfseries quazipfileinfo.cpp} 53 | \item 54 | file {\bfseries quazipfileinfo.h} 55 | \item 56 | file {\bfseries quazipnewinfo.cpp} 57 | \item 58 | file {\bfseries quazipnewinfo.h} 59 | \end{DoxyCompactItemize} 60 | -------------------------------------------------------------------------------- /quazip/doc/latex/dir_cbf6adc56048bbbfc8f6af7fd7d57800_dep.md5: -------------------------------------------------------------------------------- 1 | be1b21301b4c2eeec676c114c3df2fa2 -------------------------------------------------------------------------------- /quazip/doc/latex/dirs.tex: -------------------------------------------------------------------------------- 1 | \section{Directories} 2 | This directory hierarchy is sorted roughly, but not completely, alphabetically:\begin{DoxyCompactList} 3 | \item \contentsline{section}{quazip}{\pageref{dir_cbf6adc56048bbbfc8f6af7fd7d57800}}{} 4 | \end{DoxyCompactList} 5 | -------------------------------------------------------------------------------- /quazip/doc/latex/faq.tex: -------------------------------------------------------------------------------- 1 | \label{faq_faq-non-QIODevice} 2 | Q. Is there any way to use \doxyref{QuaZipFile}{p.}{classQuaZipFile} in Qt where you are supposed to use normal (non-\/zipped) file, but not through QIODevice API? 3 | 4 | A. Usually not. For example, if you are passing file name to some database driver (like SQLite), Qt usually just passes this name down to the 3rd-\/party library, which is usually does not know anything about QIODevice and therefore there is no way to pass \doxyref{QuaZipFile}{p.}{classQuaZipFile} as normal file. However, if we are talking about some place where you pass file name, and then indirectly use QFile to open it, then it is a good idea to make overloaded method, which accepts a QIODevice pointer. Then you would be able to pass \doxyref{QuaZipFile}{p.}{classQuaZipFile} as well as many other nice things such as QBuffer or QProcess. 5 | 6 | \label{faq_faq-zip64} 7 | Q. Can QuaZIP handle files larger than 4GB? What about zip64 standard? 8 | 9 | A. Starting with version 0.6, QuaZIP uses Minizip 1.1 with zip64 support which should handle large files perfectly. The zip64 support in Minizip looks like it's not 100\% conforming to the standard, but 3rd party tools seem to have no problem with the resulting archives. 10 | 11 | \label{faq_faq-seekable} 12 | Q. Can QuaZIP write archives to a sequential QIODevice like QTcpSocket? 13 | 14 | A. Not yet. It is not supported by vanilla Minizip (the back-\/end QuaZIP uses), although theoretically possible according to the ZIP standard. It would require some Minizip modifications that would allow it to detect non-\/seekable I/O and produce necessary output structures. QuaZIP already writes data descriptor which is necessary for non-\/seekable I/O. The only thing that is apparently left is to make Minizip fill local headers with correct values and forget about seeking after closing the file. -------------------------------------------------------------------------------- /quazip/doc/latex/hierarchy.tex: -------------------------------------------------------------------------------- 1 | \section{Class Hierarchy} 2 | This inheritance list is sorted roughly, but not completely, alphabetically:\begin{DoxyCompactList} 3 | \item \contentsline{section}{JlCompress}{\pageref{classJlCompress}}{} 4 | \item \contentsline{section}{QIODevice\_\-descriptor}{\pageref{structQIODevice__descriptor}}{} 5 | \item \contentsline{section}{QuaChecksum32}{\pageref{classQuaChecksum32}}{} 6 | \begin{DoxyCompactList} 7 | \item \contentsline{section}{QuaAdler32}{\pageref{classQuaAdler32}}{} 8 | \item \contentsline{section}{QuaCrc32}{\pageref{classQuaCrc32}}{} 9 | \end{DoxyCompactList} 10 | \item \contentsline{section}{QuaGzipFile}{\pageref{classQuaGzipFile}}{} 11 | \item \contentsline{section}{QuaZIODevice}{\pageref{classQuaZIODevice}}{} 12 | \item \contentsline{section}{QuaZip}{\pageref{classQuaZip}}{} 13 | \item \contentsline{section}{QuaZipDir}{\pageref{classQuaZipDir}}{} 14 | \item \contentsline{section}{QuaZipFile}{\pageref{classQuaZipFile}}{} 15 | \item \contentsline{section}{QuaZipFileInfo}{\pageref{structQuaZipFileInfo}}{} 16 | \item \contentsline{section}{QuaZipFileInfo64}{\pageref{structQuaZipFileInfo64}}{} 17 | \item \contentsline{section}{QuaZipFilePrivate}{\pageref{classQuaZipFilePrivate}}{} 18 | \item \contentsline{section}{QuaZipNewInfo}{\pageref{structQuaZipNewInfo}}{} 19 | \item \contentsline{section}{QuaZipPrivate}{\pageref{classQuaZipPrivate}}{} 20 | \end{DoxyCompactList} 21 | -------------------------------------------------------------------------------- /quazip/doc/latex/refman.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper]{book} 2 | \usepackage{makeidx} 3 | \usepackage{graphicx} 4 | \usepackage{multicol} 5 | \usepackage{float} 6 | \usepackage{listings} 7 | \usepackage{color} 8 | \usepackage{ifthen} 9 | \usepackage[table]{xcolor} 10 | \usepackage{textcomp} 11 | \usepackage{alltt} 12 | \usepackage[utf8]{inputenc} 13 | \usepackage{mathptmx} 14 | \usepackage[scaled=.90]{helvet} 15 | \usepackage{courier} 16 | \usepackage{sectsty} 17 | \usepackage[titles]{tocloft} 18 | \usepackage{doxygen} 19 | \lstset{language=C++,inputencoding=utf8,basicstyle=\footnotesize,breaklines=true,breakatwhitespace=true,tabsize=8,numbers=left } 20 | \makeindex 21 | \setcounter{tocdepth}{3} 22 | \renewcommand{\footrulewidth}{0.4pt} 23 | \renewcommand{\familydefault}{\sfdefault} 24 | \begin{document} 25 | \begin{titlepage} 26 | \vspace*{7cm} 27 | \begin{center} 28 | {\Large QuaZIP \\[1ex]\large quazip-\/0-\/7-\/1 }\\ 29 | \vspace*{1cm} 30 | {\large Generated by Doxygen 1.7.4}\\ 31 | \vspace*{0.5cm} 32 | {\small Wed Jan 7 2015 08:37:18}\\ 33 | \end{center} 34 | \end{titlepage} 35 | \clearemptydoublepage 36 | \pagenumbering{roman} 37 | \tableofcontents 38 | \clearemptydoublepage 39 | \pagenumbering{arabic} 40 | \chapter{QuaZIP -\/ Qt/C++ wrapper for ZIP/UNZIP package} 41 | \label{index}\input{index} 42 | \chapter{QuaZip FAQ} 43 | \label{faq} 44 | \input{faq} 45 | \chapter{Usage} 46 | \label{usage} 47 | \input{usage} 48 | \chapter{Deprecated List} 49 | \label{deprecated} 50 | \input{deprecated} 51 | \chapter{Directory Hierarchy} 52 | \input{dirs} 53 | \chapter{Class Index} 54 | \input{hierarchy} 55 | \chapter{Class Index} 56 | \input{annotated} 57 | \chapter{Directory Documentation} 58 | \input{dir_cbf6adc56048bbbfc8f6af7fd7d57800} 59 | \chapter{Class Documentation} 60 | \input{classJlCompress} 61 | \input{structQIODevice__descriptor} 62 | \input{classQuaAdler32} 63 | \input{classQuaChecksum32} 64 | \input{classQuaCrc32} 65 | \input{classQuaGzipFile} 66 | \input{classQuaZIODevice} 67 | \input{classQuaZip} 68 | \input{classQuaZipDir} 69 | \input{classQuaZipFile} 70 | \input{structQuaZipFileInfo} 71 | \input{structQuaZipFileInfo64} 72 | \input{classQuaZipFilePrivate} 73 | \input{structQuaZipNewInfo} 74 | \input{classQuaZipPrivate} 75 | \printindex 76 | \end{document} 77 | -------------------------------------------------------------------------------- /quazip/doc/latex/structQIODevice__descriptor.tex: -------------------------------------------------------------------------------- 1 | \section{QIODevice\_\-descriptor Struct Reference} 2 | \label{structQIODevice__descriptor}\index{QIODevice\_\-descriptor@{QIODevice\_\-descriptor}} 3 | \subsection*{Public Attributes} 4 | \begin{DoxyCompactItemize} 5 | \item 6 | qint64 {\bfseries pos}\label{structQIODevice__descriptor_a21939844f92cd6936f2f2897c0a42695} 7 | 8 | \end{DoxyCompactItemize} 9 | 10 | 11 | The documentation for this struct was generated from the following file:\begin{DoxyCompactItemize} 12 | \item 13 | quazip/qioapi.cpp\end{DoxyCompactItemize} 14 | -------------------------------------------------------------------------------- /quazip/includes.pri: -------------------------------------------------------------------------------- 1 | OBJECTS_DIR = .obj 2 | MOC_DIR = .moc 3 | 4 | unix { 5 | isEmpty(PREFIX): PREFIX=/usr/local 6 | } 7 | 8 | win32 { 9 | isEmpty(PREFIX): warning("PREFIX unspecified, make install won't work") 10 | } 11 | -------------------------------------------------------------------------------- /quazip/quazip.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH+=$$PWD 2 | DEPENDPATH+=$$PWD/quazip 3 | include($$PWD/quazip/quazip.pri) 4 | -------------------------------------------------------------------------------- /quazip/quazip.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE=subdirs 2 | SUBDIRS=quazip 3 | -------------------------------------------------------------------------------- /quazip/quazip.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "quazip\quazip.vcxproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qztest", "qztest\qztest.vcxproj", "{7632B767-D089-4F15-8B1E-C4B3F9EBF592}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 16 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 17 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 18 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.Build.0 = Debug|Win32 20 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.ActiveCfg = Release|Win32 21 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.Build.0 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /quazip/quazip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # set all include directories for in and out of source builds 2 | include_directories( 3 | ${CMAKE_CURRENT_SOURCE_DIR} 4 | ${CMAKE_CURRENT_BINARY_DIR} 5 | ${ZLIB_INCLUDE_DIRS} 6 | ) 7 | 8 | file(GLOB SRCS "*.c" "*.cpp") 9 | file(GLOB PUBLIC_HEADERS "*.h") 10 | 11 | # Must be added to enable export macro 12 | ADD_DEFINITIONS(-DQUAZIP_BUILD) 13 | 14 | qt_wrap_cpp(MOC_SRCS ${PUBLIC_HEADERS}) 15 | set(SRCS ${SRCS} ${MOC_SRCS}) 16 | 17 | add_library(quazip SHARED ${SRCS}) 18 | set_target_properties(quazip PROPERTIES VERSION 1.0.0 SOVERSION 1) 19 | # Link against ZLIB_LIBRARIES if needed (on Windows this variable is empty) 20 | target_link_libraries(quazip ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ${ZLIB_LIBRARIES}) 21 | 22 | install(FILES ${PUBLIC_HEADERS} DESTINATION include/quazip) 23 | install(TARGETS quazip LIBRARY DESTINATION ${LIB_DESTINATION} ARCHIVE DESTINATION ${LIB_DESTINATION} RUNTIME DESTINATION ${LIB_DESTINATION}) 24 | -------------------------------------------------------------------------------- /quazip/quazip/doc/faq.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * \page faq QuaZip FAQ 3 | * 4 | * 12 | * 13 | * \anchor faq-non-QIODevice Q. Is there any way to use QuaZipFile in Qt 14 | * where you are supposed to use normal (non-zipped) file, but not 15 | * through QIODevice API? 16 | * 17 | * A. Usually not. For example, if you are passing file name to some 18 | * database driver (like SQLite), Qt usually just passes this name down 19 | * to the 3rd-party library, which is usually does not know anything 20 | * about QIODevice and therefore there is no way to pass QuaZipFile as 21 | * normal file. However, if we are talking about some place where you 22 | * pass file name, and then indirectly use QFile to open it, then it is 23 | * a good idea to make overloaded method, which accepts a QIODevice 24 | * pointer. Then you would be able to pass QuaZipFile as well as many 25 | * other nice things such as QBuffer or QProcess. 26 | * 27 | * \anchor faq-zip64 Q. Can QuaZIP handle files larger than 4GB? What 28 | * about zip64 standard? 29 | * 30 | * A. Starting with version 0.6, QuaZIP uses Minizip 1.1 with zip64 31 | * support which should handle large files perfectly. The zip64 support 32 | * in Minizip looks like it's not 100% conforming to the standard, but 33 | * 3rd party tools seem to have no problem with the resulting archives. 34 | * 35 | * \anchor faq-seekable Q. Can QuaZIP write archives to a sequential QIODevice like QTcpSocket? 36 | * 37 | * A. Not yet. It is not supported by vanilla Minizip (the back-end 38 | * QuaZIP uses), although theoretically possible according to the ZIP 39 | * standard. It would require some Minizip modifications that would 40 | * allow it to detect non-seekable I/O and produce necessary output 41 | * structures. QuaZIP already writes data descriptor which is necessary 42 | * for non-seekable I/O. The only thing that is apparently left is to 43 | * make Minizip fill local headers with correct values and forget about 44 | * seeking after closing the file. 45 | **/ 46 | -------------------------------------------------------------------------------- /quazip/quazip/quaadler32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Adam Walczak 3 | Copyright (C) 2005-2014 Sergey A. Tachenov 4 | 5 | This file is part of QuaZIP. 6 | 7 | QuaZIP is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Lesser General Public License as published by 9 | the Free Software Foundation, either version 2.1 of the License, or 10 | (at your option) any later version. 11 | 12 | QuaZIP is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public License 18 | along with QuaZIP. If not, see . 19 | 20 | See COPYING file for the full LGPL text. 21 | 22 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 23 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 24 | */ 25 | 26 | #include "quaadler32.h" 27 | 28 | #include "zlib.h" 29 | 30 | QuaAdler32::QuaAdler32() 31 | { 32 | reset(); 33 | } 34 | 35 | quint32 QuaAdler32::calculate(const QByteArray &data) 36 | { 37 | return adler32( adler32(0L, Z_NULL, 0), (const Bytef*)data.data(), data.size() ); 38 | } 39 | 40 | void QuaAdler32::reset() 41 | { 42 | checksum = adler32(0L, Z_NULL, 0); 43 | } 44 | 45 | void QuaAdler32::update(const QByteArray &buf) 46 | { 47 | checksum = adler32( checksum, (const Bytef*)buf.data(), buf.size() ); 48 | } 49 | 50 | quint32 QuaAdler32::value() 51 | { 52 | return checksum; 53 | } 54 | -------------------------------------------------------------------------------- /quazip/quazip/quaadler32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAADLER32_H 2 | #define QUAADLER32_H 3 | 4 | /* 5 | Copyright (C) 2010 Adam Walczak 6 | Copyright (C) 2005-2014 Sergey A. Tachenov 7 | 8 | This file is part of QuaZIP. 9 | 10 | QuaZIP is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Lesser General Public License as published by 12 | the Free Software Foundation, either version 2.1 of the License, or 13 | (at your option) any later version. 14 | 15 | QuaZIP is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU Lesser General Public License for more details. 19 | 20 | You should have received a copy of the GNU Lesser General Public License 21 | along with QuaZIP. If not, see . 22 | 23 | See COPYING file for the full LGPL text. 24 | 25 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 26 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 27 | */ 28 | 29 | #include 30 | 31 | #include "quachecksum32.h" 32 | 33 | /// Adler32 checksum 34 | /** \class QuaAdler32 quaadler32.h 35 | * This class wrappers the adler32 function with the QuaChecksum32 interface. 36 | * See QuaChecksum32 for more info. 37 | */ 38 | class QUAZIP_EXPORT QuaAdler32 : public QuaChecksum32 39 | { 40 | 41 | public: 42 | QuaAdler32(); 43 | 44 | quint32 calculate(const QByteArray &data); 45 | 46 | void reset(); 47 | void update(const QByteArray &buf); 48 | quint32 value(); 49 | 50 | private: 51 | quint32 checksum; 52 | }; 53 | 54 | #endif //QUAADLER32_H 55 | -------------------------------------------------------------------------------- /quazip/quazip/quachecksum32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUACHECKSUM32_H 2 | #define QUACHECKSUM32_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | #include "quazip_global.h" 30 | 31 | /// Checksum interface. 32 | /** \class QuaChecksum32 quachecksum32.h 33 | * This is an interface for 32 bit checksums. 34 | * Classes implementing this interface can calcunate a certin 35 | * checksum in a single step: 36 | * \code 37 | * QChecksum32 *crc32 = new QuaCrc32(); 38 | * rasoult = crc32->calculate(data); 39 | * \endcode 40 | * or by streaming the data: 41 | * \code 42 | * QChecksum32 *crc32 = new QuaCrc32(); 43 | * while(!fileA.atEnd()) 44 | * crc32->update(fileA.read(bufSize)); 45 | * resoultA = crc32->value(); 46 | * crc32->reset(); 47 | * while(!fileB.atEnd()) 48 | * crc32->update(fileB.read(bufSize)); 49 | * resoultB = crc32->value(); 50 | * \endcode 51 | */ 52 | class QUAZIP_EXPORT QuaChecksum32 53 | { 54 | 55 | public: 56 | ///Calculates the checksum for data. 57 | /** \a data source data 58 | * \return data checksum 59 | * 60 | * This function has no efect on the value returned by value(). 61 | */ 62 | virtual quint32 calculate(const QByteArray &data) = 0; 63 | 64 | ///Resets the calculation on a checksun for a stream. 65 | virtual void reset() = 0; 66 | 67 | ///Updates the calculated checksum for the stream 68 | /** \a buf next portion of data from the stream 69 | */ 70 | virtual void update(const QByteArray &buf) = 0; 71 | 72 | ///Value of the checksum calculated for the stream passed throw update(). 73 | /** \return checksum 74 | */ 75 | virtual quint32 value() = 0; 76 | }; 77 | 78 | #endif //QUACHECKSUM32_H 79 | -------------------------------------------------------------------------------- /quazip/quazip/quacrc32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005-2014 Sergey A. Tachenov 3 | 4 | This file is part of QuaZIP. 5 | 6 | QuaZIP is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Lesser General Public License as published by 8 | the Free Software Foundation, either version 2.1 of the License, or 9 | (at your option) any later version. 10 | 11 | QuaZIP is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public License 17 | along with QuaZIP. If not, see . 18 | 19 | See COPYING file for the full LGPL text. 20 | 21 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 22 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 23 | */ 24 | 25 | #include "quacrc32.h" 26 | 27 | #include "zlib.h" 28 | 29 | QuaCrc32::QuaCrc32() 30 | { 31 | reset(); 32 | } 33 | 34 | quint32 QuaCrc32::calculate(const QByteArray &data) 35 | { 36 | return crc32( crc32(0L, Z_NULL, 0), (const Bytef*)data.data(), data.size() ); 37 | } 38 | 39 | void QuaCrc32::reset() 40 | { 41 | checksum = crc32(0L, Z_NULL, 0); 42 | } 43 | 44 | void QuaCrc32::update(const QByteArray &buf) 45 | { 46 | checksum = crc32( checksum, (const Bytef*)buf.data(), buf.size() ); 47 | } 48 | 49 | quint32 QuaCrc32::value() 50 | { 51 | return checksum; 52 | } 53 | -------------------------------------------------------------------------------- /quazip/quazip/quacrc32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUACRC32_H 2 | #define QUACRC32_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include "quachecksum32.h" 29 | 30 | ///CRC32 checksum 31 | /** \class QuaCrc32 quacrc32.h 32 | * This class wrappers the crc32 function with the QuaChecksum32 interface. 33 | * See QuaChecksum32 for more info. 34 | */ 35 | class QUAZIP_EXPORT QuaCrc32 : public QuaChecksum32 { 36 | 37 | public: 38 | QuaCrc32(); 39 | 40 | quint32 calculate(const QByteArray &data); 41 | 42 | void reset(); 43 | void update(const QByteArray &buf); 44 | quint32 value(); 45 | 46 | private: 47 | quint32 checksum; 48 | }; 49 | 50 | #endif //QUACRC32_H 51 | -------------------------------------------------------------------------------- /quazip/quazip/quazip.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | win32:INCLUDEPATH += C:\Qt\5.4.1\src\qtbase\src\3rdparty\zlib 3 | DEPENDPATH += $$PWD 4 | HEADERS += \ 5 | $$PWD/crypt.h \ 6 | $$PWD/ioapi.h \ 7 | $$PWD/JlCompress.h \ 8 | $$PWD/quaadler32.h \ 9 | $$PWD/quachecksum32.h \ 10 | $$PWD/quacrc32.h \ 11 | $$PWD/quagzipfile.h \ 12 | $$PWD/quaziodevice.h \ 13 | $$PWD/quazipdir.h \ 14 | $$PWD/quazipfile.h \ 15 | $$PWD/quazipfileinfo.h \ 16 | $$PWD/quazip_global.h \ 17 | $$PWD/quazip.h \ 18 | $$PWD/quazipnewinfo.h \ 19 | $$PWD/unzip.h \ 20 | $$PWD/zip.h 21 | 22 | SOURCES += $$PWD/qioapi.cpp \ 23 | $$PWD/JlCompress.cpp \ 24 | $$PWD/quaadler32.cpp \ 25 | $$PWD/quacrc32.cpp \ 26 | $$PWD/quagzipfile.cpp \ 27 | $$PWD/quaziodevice.cpp \ 28 | $$PWD/quazip.cpp \ 29 | $$PWD/quazipdir.cpp \ 30 | $$PWD/quazipfile.cpp \ 31 | $$PWD/quazipfileinfo.cpp \ 32 | $$PWD/quazipnewinfo.cpp \ 33 | $$PWD/unzip.c \ 34 | $$PWD/zip.c 35 | -------------------------------------------------------------------------------- /quazip/quazip/quazip.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | CONFIG += qt warn_on 3 | QT -= gui 4 | 5 | 6 | # The ABI version. 7 | 8 | !win32:VERSION = 1.0.0 9 | 10 | # 1.0.0 is the first stable ABI. 11 | # The next binary incompatible change will be 2.0.0 and so on. 12 | # The existing QuaZIP policy on changing ABI requires to bump the 13 | # major version of QuaZIP itself as well. Note that there may be 14 | # other reasons for chaging the major version of QuaZIP, so 15 | # in case where there is a QuaZIP major version bump but no ABI change, 16 | # the VERSION variable will stay the same. 17 | 18 | # For example: 19 | 20 | # QuaZIP 1.0 is released after some 0.x, keeping binary compatibility. 21 | # VERSION stays 1.0.0. 22 | # Then some binary incompatible change is introduced. QuaZIP goes up to 23 | # 2.0, VERSION to 2.0.0. 24 | # And so on. 25 | 26 | 27 | # This one handles dllimport/dllexport directives. 28 | DEFINES += QUAZIP_BUILD 29 | 30 | # You'll need to define this one manually if using a build system other 31 | # than qmake or using QuaZIP sources directly in your project. 32 | CONFIG(staticlib): DEFINES += QUAZIP_STATIC 33 | 34 | # Input 35 | include(quazip.pri) 36 | 37 | unix:!symbian { 38 | headers.path=$$PREFIX/include/quazip 39 | headers.files=$$HEADERS 40 | target.path=$$PREFIX/lib/$${LIB_ARCH} 41 | INSTALLS += headers target 42 | 43 | OBJECTS_DIR=.obj 44 | MOC_DIR=.moc 45 | 46 | } 47 | 48 | win32 { 49 | headers.path=$$PREFIX/include/quazip 50 | headers.files=$$HEADERS 51 | target.path=$$PREFIX/lib 52 | INSTALLS += headers target 53 | # workaround for qdatetime.h macro bug 54 | DEFINES += NOMINMAX 55 | } 56 | 57 | 58 | symbian { 59 | 60 | # Note, on Symbian you may run into troubles with LGPL. 61 | # The point is, if your application uses some version of QuaZip, 62 | # and a newer binary compatible version of QuaZip is released, then 63 | # the users of your application must be able to relink it with the 64 | # new QuaZip version. For example, to take advantage of some QuaZip 65 | # bug fixes. 66 | 67 | # This is probably best achieved by building QuaZip as a static 68 | # library and providing linkable object files of your application, 69 | # so users can relink it. 70 | 71 | CONFIG += staticlib 72 | CONFIG += debug_and_release 73 | 74 | LIBS += -lezip 75 | 76 | #Export headers to SDK Epoc32/include directory 77 | exportheaders.sources = $$HEADERS 78 | exportheaders.path = quazip 79 | for(header, exportheaders.sources) { 80 | BLD_INF_RULES.prj_exports += "$$header $$exportheaders.path/$$basename(header)" 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /quazip/quazip/quazip.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "quazip.vcproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 14 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 15 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /quazip/quazip/quazip_global.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_GLOBAL_H 2 | #define QUAZIP_GLOBAL_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | /** 31 | This is automatically defined when building a static library, but when 32 | including QuaZip sources directly into a project, QUAZIP_STATIC should 33 | be defined explicitly to avoid possible troubles with unnecessary 34 | importing/exporting. 35 | */ 36 | #ifdef QUAZIP_STATIC 37 | #define QUAZIP_EXPORT 38 | #else 39 | /** 40 | * When building a DLL with MSVC, QUAZIP_BUILD must be defined. 41 | * qglobal.h takes care of defining Q_DECL_* correctly for msvc/gcc. 42 | */ 43 | #if defined(QUAZIP_BUILD) 44 | #define QUAZIP_EXPORT Q_DECL_EXPORT 45 | #else 46 | #define QUAZIP_EXPORT Q_DECL_IMPORT 47 | #endif 48 | #endif // QUAZIP_STATIC 49 | 50 | #ifdef __GNUC__ 51 | #define UNUSED __attribute__((__unused__)) 52 | #else 53 | #define UNUSED 54 | #endif 55 | 56 | #define QUAZIP_EXTRA_NTFS_MAGIC 0x000Au 57 | #define QUAZIP_EXTRA_NTFS_TIME_MAGIC 0x0001u 58 | 59 | #endif // QUAZIP_GLOBAL_H 60 | -------------------------------------------------------------------------------- /quazip/quazip/run_moc.bat: -------------------------------------------------------------------------------- 1 | moc -o moc\moc_quazipfile.cpp quazipfile.h 2 | moc -o moc\moc_quagzipfile.cpp quagzipfile.h 3 | moc -o moc\moc_quaziodevice.cpp quaziodevice.h 4 | -------------------------------------------------------------------------------- /quazip/qztest/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | lcov --capture -b ../quazip -d ../quazip/.obj --output-file cov.info 3 | genhtml --demangle-cpp cov.info --output-directory cov 4 | -------------------------------------------------------------------------------- /quazip/qztest/qztest.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QZTEST_H 2 | #define QUAZIP_TEST_QZTEST_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | extern bool createTestFiles(const QStringList &fileNames, const QString 34 | &dir = "tmp"); 35 | extern void removeTestFiles(const QStringList &fileNames, const QString 36 | &dir = "tmp"); 37 | extern bool createTestArchive(const QString &zipName, 38 | const QStringList &fileNames, 39 | const QString &dir = "tmp"); 40 | extern bool createTestArchive(const QString &zipName, 41 | const QStringList &fileNames, 42 | QTextCodec *codec, 43 | const QString &dir = "tmp"); 44 | extern bool createTestArchive(QIODevice *ioDevice, 45 | const QStringList &fileNames, 46 | QTextCodec *codec, 47 | const QString &dir = "tmp"); 48 | 49 | #endif // QUAZIP_TEST_QZTEST_H 50 | -------------------------------------------------------------------------------- /quazip/qztest/qztest.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | QT -= gui 3 | QT += network 4 | CONFIG += qtestlib 5 | CONFIG += console 6 | CONFIG -= app_bundle 7 | DEPENDPATH += . 8 | INCLUDEPATH += . 9 | !win32: LIBS += -lz 10 | win32 { 11 | # workaround for qdatetime.h macro bug 12 | DEFINES += NOMINMAX 13 | } 14 | 15 | # Input 16 | HEADERS += qztest.h \ 17 | testjlcompress.h \ 18 | testquachecksum32.h \ 19 | testquagzipfile.h \ 20 | testquaziodevice.h \ 21 | testquazipdir.h \ 22 | testquazipfile.h \ 23 | testquazip.h \ 24 | testquazipnewinfo.h \ 25 | testquazipfileinfo.h 26 | 27 | SOURCES += qztest.cpp \ 28 | testjlcompress.cpp \ 29 | testquachecksum32.cpp \ 30 | testquagzipfile.cpp \ 31 | testquaziodevice.cpp \ 32 | testquazip.cpp \ 33 | testquazipdir.cpp \ 34 | testquazipfile.cpp \ 35 | testquazipnewinfo.cpp \ 36 | testquazipfileinfo.cpp 37 | 38 | OBJECTS_DIR = .obj 39 | MOC_DIR = .moc 40 | 41 | win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../quazip/release/ -lquazip 42 | else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazip 43 | else:unix: LIBS += -L$$OUT_PWD/../quazip/ -lquazip 44 | 45 | INCLUDEPATH += $$PWD/.. 46 | DEPENDPATH += $$PWD/../quazip 47 | -------------------------------------------------------------------------------- /quazip/qztest/qztest.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qztest", "qztest.vcproj", "{7632B767-D089-4F15-8B1E-C4B3F9EBF592}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quazip", "..\quazip\quazip.vcproj", "{E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Debug|Win32.Build.0 = Debug|Win32 16 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.ActiveCfg = Release|Win32 17 | {7632B767-D089-4F15-8B1E-C4B3F9EBF592}.Release|Win32.Build.0 = Release|Win32 18 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Debug|Win32.Build.0 = Debug|Win32 20 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.ActiveCfg = Release|Win32 21 | {E4AC5F56-B711-4F0E-BC83-CDE8B6CD53AD}.Release|Win32.Build.0 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /quazip/qztest/run_moc.bat: -------------------------------------------------------------------------------- 1 | moc -o moc\moc_testjlcompress.cpp testjlcompress.h 2 | moc -o moc\moc_testquachecksum32.cpp testquachecksum32.h 3 | moc -o moc\moc_testquazip.cpp testquazip.h 4 | moc -o moc\moc_testquazipfile.cpp testquazipfile.h 5 | moc -o moc\moc_testquazipdir.cpp testquazipdir.h 6 | moc -o moc\moc_testquagzipfile.cpp testquagzipfile.h 7 | moc -o moc\moc_testquaziodevice.cpp testquaziodevice.h 8 | -------------------------------------------------------------------------------- /quazip/qztest/testjlcompress.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_JLCOMPRESS_H 2 | #define QUAZIP_TEST_JLCOMPRESS_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | class TestJlCompress: public QObject { 31 | Q_OBJECT 32 | private slots: 33 | void compressFile_data(); 34 | void compressFile(); 35 | void compressFiles_data(); 36 | void compressFiles(); 37 | void compressDir_data(); 38 | void compressDir(); 39 | void extractFile_data(); 40 | void extractFile(); 41 | void extractFiles_data(); 42 | void extractFiles(); 43 | void extractDir_data(); 44 | void extractDir(); 45 | void zeroPermissions(); 46 | }; 47 | 48 | #endif // QUAZIP_TEST_JLCOMPRESS_H 49 | -------------------------------------------------------------------------------- /quazip/qztest/testquachecksum32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005-2014 Sergey A. Tachenov 3 | 4 | This file is part of QuaZIP test suite. 5 | 6 | QuaZIP is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU Lesser General Public License as published by 8 | the Free Software Foundation, either version 2.1 of the License, or 9 | (at your option) any later version. 10 | 11 | QuaZIP is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public License 17 | along with QuaZIP. If not, see . 18 | 19 | See COPYING file for the full LGPL text. 20 | 21 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 22 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 23 | */ 24 | 25 | #include "testquachecksum32.h" 26 | 27 | #include 28 | #include 29 | 30 | #include 31 | 32 | void TestQuaChecksum32::calculate() 33 | { 34 | QuaCrc32 crc32; 35 | QCOMPARE(crc32.calculate("Wikipedia"), 0xADAAC02Eu); 36 | QuaAdler32 adler32; 37 | QCOMPARE(adler32.calculate("Wikipedia"), 0x11E60398u); 38 | } 39 | 40 | void TestQuaChecksum32::update() 41 | { 42 | QuaCrc32 crc32; 43 | crc32.update("Wiki"); 44 | crc32.update("pedia"); 45 | QCOMPARE(crc32.value(), 0xADAAC02Eu); 46 | QuaAdler32 adler32; 47 | adler32.update("Wiki"); 48 | adler32.update("pedia"); 49 | QCOMPARE(adler32.value(), 0x11E60398u); 50 | } 51 | -------------------------------------------------------------------------------- /quazip/qztest/testquachecksum32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QUACHECKSUM32_H 2 | #define QUAZIP_TEST_QUACHECKSUM32_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | class TestQuaChecksum32: public QObject { 31 | Q_OBJECT 32 | private slots: 33 | void calculate(); 34 | void update(); 35 | }; 36 | 37 | #endif // QUAZIP_TEST_QUACHECKSUM32_H 38 | -------------------------------------------------------------------------------- /quazip/qztest/testquagzipfile.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QUAGZIPFILE_H 2 | #define QUAZIP_TEST_QUAGZIPFILE_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | class TestQuaGzipFile: public QObject { 31 | Q_OBJECT 32 | private slots: 33 | void read(); 34 | void write(); 35 | void constructorDestructor(); 36 | }; 37 | 38 | #endif // QUAZIP_TEST_QUAGZIPFILE_H 39 | -------------------------------------------------------------------------------- /quazip/qztest/testquaziodevice.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QUAZIODEVICE_H 2 | #define QUAZIP_TEST_QUAZIODEVICE_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | class TestQuaZIODevice: public QObject { 31 | Q_OBJECT 32 | private slots: 33 | void read(); 34 | void write(); 35 | }; 36 | 37 | #endif // QUAZIP_TEST_QUAZIODEVICE_H 38 | -------------------------------------------------------------------------------- /quazip/qztest/testquazip.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QUAZIP_H 2 | #define QUAZIP_TEST_QUAZIP_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | #if (QT_VERSION >= 0x050100) 31 | #define QUAZIP_TEST_QSAVEFILE 32 | #endif 33 | 34 | class TestQuaZip: public QObject { 35 | Q_OBJECT 36 | private slots: 37 | void getFileList_data(); 38 | void getFileList(); 39 | void add_data(); 40 | void add(); 41 | void setFileNameCodec_data(); 42 | void setFileNameCodec(); 43 | void setDataDescriptorWritingEnabled(); 44 | void testQIODeviceAPI(); 45 | void setZipName(); 46 | void setIoDevice(); 47 | void setCommentCodec(); 48 | void setAutoClose(); 49 | #ifdef QUAZIP_TEST_QSAVEFILE 50 | void saveFileBug(); 51 | #endif 52 | void testSequential(); 53 | }; 54 | 55 | #endif // QUAZIP_TEST_QUAZIP_H 56 | -------------------------------------------------------------------------------- /quazip/qztest/testquazipdir.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QUAZIPDIR_H 2 | #define QUAZIP_TEST_QUAZIPDIR_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | 30 | class TestQuaZipDir: public QObject { 31 | Q_OBJECT 32 | private slots: 33 | void entryList_data(); 34 | void entryList(); 35 | void cd_data(); 36 | void cd(); 37 | void entryInfoList(); 38 | void operators(); 39 | void filePath(); 40 | }; 41 | 42 | #endif // QUAZIP_TEST_QUAZIPDIR_H 43 | -------------------------------------------------------------------------------- /quazip/qztest/testquazipfile.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAZIP_TEST_QUAZIPFILE_H 2 | #define QUAZIP_TEST_QUAZIPFILE_H 3 | 4 | /* 5 | Copyright (C) 2005-2014 Sergey A. Tachenov 6 | 7 | This file is part of QuaZIP test suite. 8 | 9 | QuaZIP is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 2.1 of the License, or 12 | (at your option) any later version. 13 | 14 | QuaZIP is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with QuaZIP. If not, see . 21 | 22 | See COPYING file for the full LGPL text. 23 | 24 | Original ZIP package is copyrighted by Gilles Vollant and contributors, 25 | see quazip/(un)zip.h files for details. Basically it's the zlib license. 26 | */ 27 | 28 | #include 29 | #include 30 | 31 | class TestQuaZipFile: public QObject { 32 | Q_OBJECT 33 | private slots: 34 | void zipUnzip_data(); 35 | void zipUnzip(); 36 | void bytesAvailable_data(); 37 | void bytesAvailable(); 38 | void atEnd_data(); 39 | void atEnd(); 40 | void pos_data(); 41 | void pos(); 42 | void getZip(); 43 | void setZipName(); 44 | void getFileInfo(); 45 | void setFileName(); 46 | void constructorDestructor(); 47 | void setFileAttrs(); 48 | void largeFile(); 49 | }; 50 | 51 | #endif // QUAZIP_TEST_QUAZIPFILE_H 52 | -------------------------------------------------------------------------------- /quazip/qztest/testquazipfileinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTQUAZIPFILEINFO_H 2 | #define TESTQUAZIPFILEINFO_H 3 | 4 | #include 5 | 6 | class TestQuaZipFileInfo : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit TestQuaZipFileInfo(QObject *parent = 0); 11 | private slots: 12 | void getNTFSTime(); 13 | }; 14 | 15 | #endif // TESTQUAZIPFILEINFO_H 16 | -------------------------------------------------------------------------------- /quazip/qztest/testquazipnewinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTQUAZIPNEWINFO_H 2 | #define TESTQUAZIPNEWINFO_H 3 | 4 | #include 5 | 6 | class TestQuaZipNewInfo : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit TestQuaZipNewInfo(QObject *parent = 0); 11 | private slots: 12 | void setFileNTFSTimes(); 13 | }; 14 | 15 | #endif // TESTQUAZIPNEWINFO_H 16 | -------------------------------------------------------------------------------- /screenshot1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/screenshot1.jpg -------------------------------------------------------------------------------- /screenshot2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/screenshot2.jpg -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | strava_auth.h 2 | runkeeper_auth.h 3 | smashrun_auth.h -------------------------------------------------------------------------------- /src/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TTWatcher / File Not Found - 404 4 | 5 | 6 | 7 | 8 |

File Not Found

9 |
10 | 11 |

The file requested could not be found.

12 |
13 | TTWatcher 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrincipalClass 6 | NSApplication 7 | CFBundleIconFile 8 | runningman2.icns 9 | CFBundlePackageType 10 | APPL 11 | CFBundleGetInfoString 12 | Created by Qt/QMake 13 | CFBundleSignature 14 | ???? 15 | CFBundleExecutable 16 | ttwatcher 17 | CFBundleIdentifier 18 | ghj.ttwatcher 19 | NOTE 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/aboutdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ABOUTDIALOG_H 2 | #define ABOUTDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class AboutDialog; 10 | } 11 | 12 | class AboutDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | QNetworkAccessManager m_Manager; 16 | QUrl m_LatestVersionUrl; 17 | public: 18 | explicit AboutDialog(QWidget *parent = 0); 19 | ~AboutDialog(); 20 | 21 | private slots: 22 | void on_pushButton_clicked(); 23 | void onFinished(QNetworkReply * reply); 24 | void on_downloadLatestButton_clicked(); 25 | 26 | private: 27 | Ui::AboutDialog *ui; 28 | protected: 29 | // returns true if new version is available. 30 | bool compareVersions(QString tagName); 31 | void showEvent(QShowEvent *e); 32 | }; 33 | 34 | #endif // ABOUTDIALOG_H 35 | -------------------------------------------------------------------------------- /src/activity.h: -------------------------------------------------------------------------------- 1 | #ifndef ACTIVITY_H 2 | #define ACTIVITY_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "lap.h" 8 | 9 | 10 | class Activity 11 | { 12 | 13 | public: 14 | enum Sport { RUNNING, TREADMILL, BIKING, SWIMMING, STOPWATCH, FREESTYLE, OTHER }; 15 | 16 | Activity(); 17 | 18 | QDateTime date() const; 19 | void setDate( const QDateTime & date ); 20 | LapList & laps(); 21 | QString notes() const; 22 | void setNotes( const QString & notes ); 23 | Sport sport() const; 24 | void setSport(Sport sport); 25 | QString sportString() const; 26 | static QString sportToString( Sport sport ); 27 | 28 | void setFilename( const QString & filename); 29 | QString filename() const; 30 | 31 | QString toString() const; 32 | TrackPointPtr find( int secondsSinceStart ); 33 | 34 | void setDistance( float distance ); 35 | float distance() const; 36 | void setDuration( quint32 duration); 37 | quint32 duration() const; 38 | 39 | 40 | private: 41 | LapList m_Laps; 42 | QDateTime m_Date; 43 | QString m_Notes; 44 | Sport m_Sport; 45 | QString m_Filename; 46 | quint32 m_Duration; 47 | float m_Distance; 48 | 49 | }; 50 | 51 | typedef QSharedPointerActivityPtr; 52 | Q_DECLARE_METATYPE( ActivityPtr ) 53 | 54 | #endif // ACTIVITY_H 55 | -------------------------------------------------------------------------------- /src/arrow68.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/arrow68.png -------------------------------------------------------------------------------- /src/bridge.h: -------------------------------------------------------------------------------- 1 | #ifndef BRIDGE_H 2 | #define BRIDGE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "trackpoint.h" 8 | 9 | class BridgePoint{ 10 | QPointF m_Coordinate; 11 | double m_Elevation; 12 | public: 13 | BridgePoint( const QPointF & coordinate, double elevation ) : m_Coordinate(coordinate), m_Elevation(elevation) { 14 | } 15 | BridgePoint( double latitude, double longitude, double elevation ) : m_Coordinate(longitude, latitude), m_Elevation(elevation) { 16 | } 17 | BridgePoint ( ) : m_Elevation(0.0) { 18 | } 19 | 20 | const QPointF & coordinate() const { 21 | return m_Coordinate; 22 | } 23 | void setCoordinate( const QPointF & p ) { 24 | m_Coordinate = p; 25 | } 26 | void setLatitude(double latitude ) { 27 | m_Coordinate.setY(latitude); 28 | } 29 | void setLongitude(double longitude) { 30 | m_Coordinate.setX(longitude); 31 | } 32 | double elevation() const { 33 | return m_Elevation; 34 | } 35 | void setElevation( double elevation ) { 36 | m_Elevation = elevation; 37 | } 38 | }; 39 | 40 | class Bridge; 41 | typedef QListBridgeList; 42 | typedef QList BridgePointList; 43 | 44 | class Bridge { 45 | QString m_Name; 46 | BridgePointList m_Bridge; 47 | QRectF m_Bounds; 48 | double m_Length; 49 | 50 | // meters that one has to be from the bridge path to be concidered on the bridge. 51 | double m_CaptureWidth; 52 | 53 | bool isOnBridge(const QPointF&p, double &elevation, int &index) const; 54 | void initialize(); 55 | public: 56 | Bridge( const QString & name, const BridgePointList & bridge, double captureWidth ); 57 | Bridge( const QString & name = "", double captureWidth = 20.0 ); 58 | bool isNearBridge( TrackPointList track ) const; 59 | bool fixBridge ( TrackPointList track ) const; 60 | 61 | const QString name() const; 62 | void setName(const QString &name); 63 | const double captureWidth() const; 64 | void setCaptureWidth( double captureWidth ); 65 | BridgePointList & points(); 66 | const BridgePointList & constPoints() const; 67 | 68 | static bool loadBridgeFile(const QString &filename, BridgeList & bridgeList); 69 | static bool loadBridgeFiles(const QString & dir, BridgeList & bridgeList); 70 | static bool loadBridgeFiles(BridgeList &bridgeList); 71 | 72 | static bool saveBridgeFile(const QString &filename, BridgeList & bridgeList); 73 | }; 74 | 75 | 76 | 77 | #endif // BRIDGE_H 78 | -------------------------------------------------------------------------------- /src/bridgeeditordialog.h: -------------------------------------------------------------------------------- 1 | #ifndef BRIDGEEDITORDIALOG_H 2 | #define BRIDGEEDITORDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "bridge.h" 10 | #include "settings.h" 11 | #include "bridgepointitemmodel.h" 12 | #include "elevation.h" 13 | 14 | namespace Ui { 15 | class BridgeEditorDialog; 16 | } 17 | 18 | class BridgeEditorDialog : public QDialog 19 | { 20 | Q_OBJECT 21 | 22 | Elevation m_Elevation; 23 | Settings * m_Settings; 24 | QList m_BridgeFiles; 25 | QString m_Filename; 26 | BridgeList m_Bridges; 27 | bool m_BridgeFileChanged2; 28 | int m_CurrentBridgeFileIndex; 29 | BridgePointItemModel m_Model; 30 | QStatusBar * m_StatusBar; 31 | 32 | QString baseDir() const; 33 | void showBridges(const QString ¤tBridge); 34 | void loadBridge( int index ); 35 | void loadBridgeFile( const QString & filename ); 36 | void loadUserBridgeFiles(); 37 | void setChanged( bool changed ); 38 | void dialogState(); 39 | public: 40 | explicit BridgeEditorDialog(Settings * settings, QWidget *parent = 0); 41 | ~BridgeEditorDialog(); 42 | 43 | private: 44 | Ui::BridgeEditorDialog *ui; 45 | private slots: 46 | void currentBridgeFileChanged( int index ); 47 | void currentBridgeChanged( int index ); 48 | void bridgePointSelected( int index, QPoint pos ); 49 | void bridgePointUnselected( int index ); 50 | void bridgePointMoved( int index, QPointF pos ); 51 | void mapClicked( qreal latitude, qreal longitude ); 52 | void mouseMoved(QPointF pos); 53 | void onTileChanged(); 54 | void on_newFileButton_clicked(); 55 | void on_newBridge_clicked(); 56 | void on_deleteBridge_clicked(); 57 | bool on_applyButton_clicked(); 58 | void on_okButton_clicked(); 59 | void on_cancelButton_clicked(); 60 | 61 | void on_removeBridgePoint_clicked(); 62 | void on_renameButton_clicked(); 63 | void on_generateButton_clicked(); 64 | void on_captureWidthSpin_valueChanged(int arg1); 65 | }; 66 | 67 | #endif // BRIDGEEDITORDIALOG_H 68 | -------------------------------------------------------------------------------- /src/bridgepointitemmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef BRIDGEPOINTITEMMODEL_H 2 | #define BRIDGEPOINTITEMMODEL_H 3 | 4 | #include 5 | #include "bridge.h" 6 | 7 | class BridgePointItemModel : public QAbstractItemModel 8 | { 9 | Q_OBJECT 10 | Bridge * m_Bridge; 11 | int m_SelectedPoint; 12 | public: 13 | explicit BridgePointItemModel(QObject *parent = 0); 14 | void setBridge( Bridge * bridge ); 15 | Bridge * bridge() const; 16 | int selectedPoint() const; 17 | int columnCount(const QModelIndex &parent) const; 18 | int rowCount(const QModelIndex &parent) const; 19 | QModelIndex index(int row, int column, const QModelIndex &parent) const; 20 | QModelIndex parent(const QModelIndex &child) const; 21 | bool hasChildren(const QModelIndex &parent = QModelIndex()) const; 22 | QVariant data(const QModelIndex &index, int role) const; 23 | bool setData(const QModelIndex &index, const QVariant &value, int role); 24 | QVariant headerData(int section, Qt::Orientation orientation, int role) const; 25 | Qt::ItemFlags flags(const QModelIndex &index) const; 26 | Qt::DropActions supportedDropActions() const; 27 | 28 | signals: 29 | 30 | public slots: 31 | void selectPoint( int index ); 32 | void bridgePointUpdated(int index); 33 | 34 | void removePoint(int index); 35 | void addPoint( const QPointF & pos, double elevation ); 36 | void replacePoints( BridgePointList & bpl ); 37 | 38 | }; 39 | 40 | #endif // BRIDGEPOINTITEMMODEL_H 41 | -------------------------------------------------------------------------------- /src/centeredexpmovavg.cpp: -------------------------------------------------------------------------------- 1 | #include "centeredexpmovavg.h" 2 | #include 3 | 4 | CenteredExpMovAvg::CenteredExpMovAvg(int windowSize, double base) : 5 | m_WindowSize(windowSize) 6 | { 7 | if ( m_WindowSize < 0 ) 8 | { 9 | m_WindowSize = 61; 10 | } 11 | 12 | if ( m_WindowSize % 2 == 0 ) 13 | { 14 | m_WindowSize++; 15 | } 16 | 17 | int center = m_WindowSize / 2; 18 | m_Weights.resize(m_WindowSize); 19 | double * weights = m_Weights.data(); 20 | 21 | weights[center] = 1; 22 | double normalize = weights[center]; 23 | 24 | // we are allowed to do <= here and access element center + center since 25 | // we are enforcing a odd number of elements 26 | for (int i=1; i <= center; i++ ) 27 | { 28 | double weight = pow(base,i); 29 | weights[ center + i ] = weight; 30 | weights[ center - i ] = weight; 31 | normalize += weight * 2; 32 | } 33 | 34 | // normalize. 35 | for (int i=0;i= m_Data.length() ) 49 | { 50 | pos = m_Data.length() - 1; 51 | } 52 | if ( pos < 0 ) 53 | { 54 | pos = 0; 55 | } 56 | 57 | int center = m_WindowSize / 2; 58 | int minPos = qMax(0, pos-center); 59 | int offset = abs(qMin(0, pos-center)); 60 | int maxPos = qMin(m_Data.length()-1, pos+center); 61 | 62 | 63 | const double * values = m_Data.data(); 64 | const double * weights = m_Weights.data(); 65 | 66 | double v = 0; 67 | 68 | if ( maxPos - minPos < m_WindowSize - 1) 69 | { 70 | // if we don't use the full window, we 71 | // have to recalculate the normalization factor. 72 | double normalize = 0; 73 | for (int i=minPos;i 5 | 6 | class CenteredExpMovAvg 7 | { 8 | typedef QVector Data; 9 | Data m_Data; 10 | Data m_Weights; 11 | int m_WindowSize; 12 | 13 | public: 14 | 15 | CenteredExpMovAvg(int windowSize = 61, double base = 0.95); 16 | void add(double data); 17 | double cea(int pos) const; 18 | int size() const; 19 | 20 | }; 21 | 22 | #endif // CENTERED_EXPONENTIONAL_MOVING_AVERAGE_H 23 | -------------------------------------------------------------------------------- /src/datasetdownloadericons.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/gears6.png 4 | icons/ok.png 5 | icons/test20.png 6 | icons/time28.png 7 | icons/boxes37.png 8 | icons/internet43.png 9 | srtm.txt 10 | ned1.txt 11 | ned2.txt 12 | ned13.txt 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/datasmoothing.cpp: -------------------------------------------------------------------------------- 1 | #include "datasmoothing.h" 2 | 3 | -------------------------------------------------------------------------------- /src/datasmoothing.h: -------------------------------------------------------------------------------- 1 | #ifndef DATASMOOTHING_H 2 | #define DATASMOOTHING_H 3 | 4 | #include 5 | 6 | // sliding window moving average 7 | template 8 | class DataSmoothing 9 | { 10 | QVector m_Data; 11 | int m_Interval; 12 | double m_RunningTotal; 13 | public: 14 | DataSmoothing(int interval=60) : 15 | m_Interval(interval), 16 | m_RunningTotal(0.0) { 17 | } 18 | 19 | double add( T v ) { 20 | m_Data.push_back(v); 21 | m_RunningTotal+=v; 22 | while ( m_Data.length() > m_Interval ) 23 | { 24 | m_RunningTotal -= m_Data.front(); 25 | m_Data.pop_front(); 26 | } 27 | return m_RunningTotal / m_Data.length(); 28 | } 29 | 30 | 31 | double value () const { 32 | if ( m_Data.length() > 0 ) 33 | { 34 | return m_RunningTotal / m_Data.length(); 35 | } 36 | else 37 | { 38 | return 0; 39 | } 40 | } 41 | 42 | void clear() { 43 | m_RunningTotal = 0; 44 | m_Data.clear(); 45 | } 46 | 47 | int count() const { 48 | return m_Data.count(); 49 | } 50 | }; 51 | 52 | #endif // DATASMOOTHING_H 53 | -------------------------------------------------------------------------------- /src/document4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/document4.png -------------------------------------------------------------------------------- /src/door9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/door9.png -------------------------------------------------------------------------------- /src/downloaddialog.h: -------------------------------------------------------------------------------- 1 | #ifndef DOWNLOADDIALOG_H 2 | #define DOWNLOADDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | #include "ttmanager.h" 8 | #include "settings.h" 9 | 10 | namespace Ui { 11 | class DownloadDialog; 12 | } 13 | 14 | class DownloadDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | Settings * m_Settings; 18 | TTManager * m_TTManager; 19 | QNetworkAccessManager m_Manager; 20 | QStringList m_Files; 21 | bool m_ManualDownload; 22 | 23 | protected: 24 | void showEvent(QShowEvent *e); 25 | 26 | public: 27 | explicit DownloadDialog(Settings * settings, TTManager * ttManager, QWidget *parent = 0); 28 | ~DownloadDialog(); 29 | int processWatches(bool manualDownload); 30 | QStringList filesDownloaded() const; 31 | signals: 32 | void filesAvailable(); 33 | private slots: 34 | void process(); 35 | void workInfo( const QString & message, bool done ); 36 | void onFinished(QNetworkReply * reply ); 37 | void onExportingFinished(); 38 | void onExportError( QString message ); 39 | private: 40 | Ui::DownloadDialog *ui; 41 | }; 42 | 43 | #endif // DOWNLOADDIALOG_H 44 | -------------------------------------------------------------------------------- /src/downloaddialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DownloadDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | TT Watch Communications... 15 | 16 | 17 | 18 | 19 | 20 | Downloading... 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 0 32 | 0 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 0 41 | 42 | 43 | 0 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | Qt::Horizontal 52 | 53 | 54 | 55 | 298 56 | 20 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | false 65 | 66 | 67 | Cancel 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/elevation.h: -------------------------------------------------------------------------------- 1 | #ifndef ELEVATION_H 2 | #define ELEVATION_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "elevationtile.h" 9 | 10 | class Elevation : public QObject 11 | { 12 | Q_OBJECT 13 | 14 | QString m_BasePath; 15 | QList m_Tiles; 16 | ElevationTile * m_LastTile; 17 | public: 18 | Elevation( const QString & basePath = QString() ); 19 | ~Elevation(); 20 | void clear(); 21 | void prepare(); 22 | QString basePath () const; 23 | 24 | enum ElevationResult { ER_NO_DATA, ER_NO_TILE, ER_SUCCESS }; 25 | bool hasElevation( const QPointF &p ); 26 | ElevationResult elevation( const QPointF & p, float & elevation ); 27 | ElevationSource dataSources( const QPointF & p ); 28 | 29 | }; 30 | 31 | #endif // ELEVATION_H 32 | -------------------------------------------------------------------------------- /src/elevationdownloaderitem.h: -------------------------------------------------------------------------------- 1 | #ifndef ELEVATIONDOWNLOADERITEM_H 2 | #define ELEVATIONDOWNLOADERITEM_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ElevationTileDownloaderItem : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit ElevationTileDownloaderItem(int id, QObject *parent = 0); 14 | ~ElevationTileDownloaderItem(); 15 | QVariant data(int column, int role) const; 16 | 17 | QString name; 18 | QStringList urls; 19 | QString destDir; 20 | 21 | 22 | QTemporaryFile * f; 23 | QNetworkReply * reply; 24 | 25 | void setRetries(int retries); 26 | int retries() const; 27 | void setProgress(float progress); 28 | enum Status { WAITING, DOWNLOADING, UNPACKING, SUCCESS, FAILED }; 29 | void setStatus( Status status ); 30 | Status status() const; 31 | int id() const; 32 | signals: 33 | void cellChanged(int id); 34 | 35 | public slots: 36 | 37 | private: 38 | int m_Id; 39 | int m_Retries; 40 | float m_Progress; 41 | 42 | Status m_Status; 43 | 44 | }; 45 | 46 | typedef QList ElevationDownloaderItemList; 47 | 48 | #endif // ELEVATIONDOWNLOADERITEM_H 49 | -------------------------------------------------------------------------------- /src/elevationdownloaderitemmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef ELEVATIONDOWNLOADERITEMMODEL_H 2 | #define ELEVATIONDOWNLOADERITEMMODEL_H 3 | 4 | #include 5 | #include "elevationdownloaderitem.h" 6 | #include "elevationtile.h" 7 | 8 | class ElevationDownloaderItemModel : public QAbstractItemModel 9 | { 10 | Q_OBJECT 11 | ElevationDownloaderItemList m_List; 12 | public: 13 | explicit ElevationDownloaderItemModel(QObject *parent = 0); 14 | int columnCount(const QModelIndex &parent) const; 15 | int rowCount(const QModelIndex &parent) const; 16 | QModelIndex index(int row, int column, const QModelIndex &parent) const; 17 | QModelIndex parent(const QModelIndex &child) const; 18 | bool hasChildren(const QModelIndex &parent = QModelIndex()) const; 19 | QVariant data(const QModelIndex &index, int role) const; 20 | QVariant headerData(int section, Qt::Orientation orientation, int role) const; 21 | const ElevationDownloaderItemList &list() const; 22 | signals: 23 | public slots: 24 | void addSource(ElevationSource & source); 25 | private slots: 26 | void cellChanged(int id); 27 | }; 28 | 29 | #endif // ELEVATIONDOWNLOADERITEMMODEL_H 30 | -------------------------------------------------------------------------------- /src/elevationloader.h: -------------------------------------------------------------------------------- 1 | #ifndef ELEVATIONLOADER_H 2 | #define ELEVATIONLOADER_H 3 | 4 | #include 5 | #include 6 | 7 | #include "activity.h" 8 | 9 | class ElevationLoader : public QObject 10 | { 11 | Q_OBJECT 12 | 13 | QNetworkAccessManager m_Manager; 14 | 15 | public: 16 | 17 | ElevationLoader( QObject * parent = 0); 18 | 19 | enum Status { IDLE, DOWNLOADING, SUCCESS, FAILED }; 20 | enum Source { USE_TT, USE_SRTMANDNED }; 21 | 22 | 23 | 24 | Status load( ActivityPtr activity, Source source = USE_SRTMANDNED, bool synchronous = false, bool fullReload = false ); 25 | Status status() const; 26 | private slots: 27 | void finished( QNetworkReply * reply ); 28 | signals: 29 | void loaded( bool success, ActivityPtr activity ); 30 | private: 31 | Status m_Status; 32 | Status loadTT(ActivityPtr activity,bool synchronous ); 33 | Status loadSRTM(ActivityPtr activity); 34 | bool process(ActivityPtr activity, QByteArray data ); 35 | }; 36 | 37 | #endif // ELEVATIONLOADER_H 38 | -------------------------------------------------------------------------------- /src/elevationtile.cpp: -------------------------------------------------------------------------------- 1 | #include "elevationtile.h" 2 | 3 | ElevationTile::ElevationTile(QObject * parent) : QObject(parent) 4 | { 5 | } 6 | 7 | ElevationTile::~ElevationTile() 8 | { 9 | 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/elevationtile.h: -------------------------------------------------------------------------------- 1 | #ifndef ELEVATIONTILE_H 2 | #define ELEVATIONTILE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | // longitude = +east / -west = X 11 | // latitude = +north / -south = Y 12 | 13 | class ElevationSource { 14 | public: 15 | ElevationSource() : valid(false) {} 16 | ElevationSource( QUrl _url, QString _baseDir, double _arcSeconds, QString _source, QPointF _p) : 17 | url(_url), 18 | baseDir(_baseDir), 19 | arcSeconds(_arcSeconds), 20 | source(_source), 21 | valid(true), 22 | southWest( _p.x(), _p.y(), 1.0, 1.0) 23 | {} 24 | 25 | QUrl url; 26 | QString baseDir; 27 | double arcSeconds; 28 | QString source; 29 | bool valid; 30 | QRectF southWest; 31 | double m_Degrees; 32 | bool contains( const QPointF & p ) { 33 | return southWest.contains(p); 34 | } 35 | }; 36 | typedef QListElevationSourceList; 37 | 38 | 39 | class ElevationTile : public QObject 40 | { 41 | Q_OBJECT 42 | public: 43 | ElevationTile(QObject * parent = 0); 44 | virtual ~ElevationTile(); 45 | 46 | virtual bool readHeader () = 0; 47 | 48 | virtual bool open() = 0; 49 | virtual void close() = 0; 50 | virtual bool isOpen() const = 0; 51 | 52 | // box edges included 53 | virtual QPointF bottomLeft() const = 0; 54 | virtual QPointF topRight() const = 0; 55 | virtual bool contains( const QPointF & p ) const = 0; 56 | 57 | // accuracy 58 | virtual float arcSeconds() const = 0; 59 | 60 | // calculation. 61 | virtual bool elevation( const QPointF & p, float & elevation ) const = 0; 62 | 63 | // removes the tiles from HD. 64 | virtual bool removeFiles() = 0; 65 | }; 66 | 67 | #endif // ELEVATIONTILE_H 68 | -------------------------------------------------------------------------------- /src/elevationtiledownloaderdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ELEVATIONTILEDOWNLOADERDIALOG_H 2 | #define ELEVATIONTILEDOWNLOADERDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "elevation.h" 12 | #include "elevationdownloaderitem.h" 13 | #include "elevationdownloaderitemmodel.h" 14 | 15 | namespace Ui { 16 | class ElevationTileDownloaderDialog; 17 | } 18 | 19 | class ElevationTileDownloaderDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | QString m_BaseDir; 24 | ElevationDownloaderItemModel m_ListModel; 25 | QNetworkAccessManager m_Manager; 26 | QList m_Replies; 27 | 28 | bool unpack(ElevationTileDownloaderItem * item); 29 | void download(ElevationTileDownloaderItem * item ); 30 | 31 | void checkDone(); 32 | void closeEvent(QCloseEvent *e); 33 | 34 | public: 35 | explicit ElevationTileDownloaderDialog(const QString & baseDir, QWidget *parent = 0); 36 | ~ElevationTileDownloaderDialog(); 37 | void addSource(ElevationSource & source); 38 | void go(); 39 | 40 | 41 | 42 | private slots: 43 | 44 | void on_cancelButton_clicked(); 45 | 46 | private: 47 | Ui::ElevationTileDownloaderDialog *ui; 48 | }; 49 | 50 | #endif // ELEVATIONTILEDOWNLOADERDIALOG_H 51 | -------------------------------------------------------------------------------- /src/elevationtiledownloaderdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ElevationTileDownloaderDialog 4 | 5 | 6 | Qt::ApplicationModal 7 | 8 | 9 | 10 | 0 11 | 0 12 | 400 13 | 300 14 | 15 | 16 | 17 | Elevation Tile Downloader 18 | 19 | 20 | 21 | 22 | 23 | Downloading Elevation Data. This should only be needed once per general area you run in. 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | 32 | 33 | false 34 | 35 | 36 | false 37 | 38 | 39 | 25 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 9 48 | 49 | 50 | 0 51 | 52 | 53 | 0 54 | 55 | 56 | 0 57 | 58 | 59 | 0 60 | 61 | 62 | 63 | 64 | Qt::Horizontal 65 | 66 | 67 | 68 | 211 69 | 20 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | Cancel 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /src/empty_tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/empty_tile.png -------------------------------------------------------------------------------- /src/exportworkingdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef EXPORTWORKINGDIALOG_H 2 | #define EXPORTWORKINGDIALOG_H 3 | 4 | #include 5 | #include "watchexporters.h" 6 | #include "activity.h" 7 | #include 8 | 9 | namespace Ui { 10 | class ExportWorkingDialog; 11 | } 12 | 13 | class ExportWorkingDialog : public QDialog 14 | { 15 | Q_OBJECT 16 | ActivityPtr m_Activity; 17 | WatchExportersPtr m_Exporters; 18 | QString m_ExporterName; 19 | bool m_HadError; 20 | QTimer m_Timer; 21 | 22 | // void showEvent(QShowEvent *e); 23 | 24 | public: 25 | explicit ExportWorkingDialog(ActivityPtr activity, WatchExportersPtr exporters, const QString &exporterName, QWidget *parent = 0); 26 | ~ExportWorkingDialog(); 27 | 28 | private slots: 29 | void process(); 30 | void workInfo(const QString &message, bool done); 31 | void onExportingFinished(); 32 | 33 | void onExportFinished( bool success, QString message, QUrl url ); 34 | 35 | void on_cancelButton_clicked(); 36 | 37 | private: 38 | Ui::ExportWorkingDialog *ui; 39 | }; 40 | 41 | #endif // EXPORTWORKINGDIALOG_H 42 | -------------------------------------------------------------------------------- /src/exportworkingdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExportWorkingDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Exporter 15 | 16 | 17 | 18 | 19 | 20 | Exporting... 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 0 32 | 0 33 | 34 | 35 | 36 | 37 | 0 38 | 39 | 40 | 0 41 | 42 | 43 | 0 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | Qt::Horizontal 52 | 53 | 54 | 55 | 298 56 | 20 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | false 65 | 66 | 67 | OK 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /src/flatfileiconprovider.cpp: -------------------------------------------------------------------------------- 1 | #include "flatfileiconprovider.h" 2 | 3 | 4 | FlatFileIconProvider::FlatFileIconProvider() : 5 | m_File( ":/icons/watch_small.png"), 6 | m_Folder( ":/icons/folder250.png") 7 | { 8 | 9 | } 10 | 11 | QIcon FlatFileIconProvider::icon(QFileIconProvider::IconType type) const 12 | { 13 | switch ( type ) 14 | { 15 | case QFileIconProvider::File: 16 | return m_File; 17 | default: 18 | return m_Folder; 19 | } 20 | } 21 | 22 | QIcon FlatFileIconProvider::icon(const QFileInfo &info) const 23 | { 24 | if ( info.isDir() ) 25 | { 26 | return m_Folder; 27 | } 28 | 29 | return m_File; 30 | } 31 | -------------------------------------------------------------------------------- /src/flatfileiconprovider.h: -------------------------------------------------------------------------------- 1 | #ifndef FLATFILEICONPROVIDER_H 2 | #define FLATFILEICONPROVIDER_H 3 | 4 | #include 5 | #include 6 | 7 | class FlatFileIconProvider : public QFileIconProvider 8 | { 9 | QIcon m_File; 10 | QIcon m_Folder; 11 | public: 12 | explicit FlatFileIconProvider(); 13 | QIcon icon(IconType type) const; 14 | QIcon icon(const QFileInfo &info) const; 15 | signals: 16 | 17 | public slots: 18 | 19 | }; 20 | 21 | #endif // FLATFILEICONPROVIDER_H 22 | -------------------------------------------------------------------------------- /src/folder250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/folder250.png -------------------------------------------------------------------------------- /src/geodistance.h: -------------------------------------------------------------------------------- 1 | #ifndef GEODISTANCE_H 2 | #define GEODISTANCE_H 3 | 4 | double geodistance(double lat1, double lon1, double lat2, double lon2, char unit); 5 | 6 | #endif // GEODISTANCE_H 7 | -------------------------------------------------------------------------------- /src/gridfloatelevationtile.h: -------------------------------------------------------------------------------- 1 | #ifndef GRIDFLOATELEVATIONTILE_H 2 | #define GRIDFLOATELEVATIONTILE_H 3 | 4 | #include "elevationtile.h" 5 | 6 | #include 7 | #include 8 | 9 | class GridFloatElevationTile : public ElevationTile 10 | { 11 | Q_OBJECT 12 | 13 | QString m_Filename; 14 | QPointF m_BottomLeft; 15 | QPointF m_TopRight; 16 | QFile m_File; 17 | // float m_ArcSeconds; 18 | int m_Rows; 19 | int m_Cols; 20 | quint64 m_Filesize; 21 | float m_CellSize; // in degrees. 22 | float * m_Data; 23 | float m_NoData; 24 | bool m_LSBFirst; 25 | 26 | 27 | static bool lookup( const QString &list, const QString &fn ); 28 | 29 | public: 30 | GridFloatElevationTile(const QString & filename, QObject * parent = 0); 31 | virtual ~GridFloatElevationTile(); 32 | 33 | virtual bool readHeader(); 34 | virtual bool open(); 35 | virtual void close(); 36 | virtual bool isOpen() const; 37 | virtual QPointF bottomLeft() const; 38 | virtual QPointF topRight() const; 39 | virtual bool contains( const QPointF & p ) const; 40 | virtual float arcSeconds() const; 41 | virtual bool elevation( const QPointF & p, float & elevation ) const; 42 | virtual bool removeFiles(); 43 | 44 | static ElevationSourceList dataSetURLs( const QPointF &p ); 45 | 46 | }; 47 | 48 | #endif // GRIDFLOATELEVATIONTILE_H 49 | -------------------------------------------------------------------------------- /src/hard13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/hard13.png -------------------------------------------------------------------------------- /src/heart254.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/heart254.png -------------------------------------------------------------------------------- /src/hidpi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/hidpi.h -------------------------------------------------------------------------------- /src/home10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/home10.png -------------------------------------------------------------------------------- /src/httpserver.h: -------------------------------------------------------------------------------- 1 | #ifndef HTTPSERVER_H 2 | #define HTTPSERVER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class HttpServer : public QObject 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit HttpServer(QObject *parent = 0); 17 | 18 | static HttpServer * singleton(bool destroy=false); 19 | quint16 port() const; 20 | 21 | typedef std::function< void ( QHttpRequest *req, QHttpResponse *resp ) > Callback; 22 | QUrl registerCallback( Callback cb ); 23 | void unregisterCallback ( const QString & path ); 24 | 25 | void respond(const QString & filename, int code, QHttpRequest *req, QHttpResponse *resp); 26 | signals: 27 | 28 | private slots: 29 | void handle(QHttpRequest *req, QHttpResponse *resp); 30 | 31 | private: 32 | quint16 m_Port; 33 | QHttpServer m_Server; 34 | QMap< QString, Callback > m_Callbacks; 35 | }; 36 | 37 | #endif // HTTPSERVER_H 38 | -------------------------------------------------------------------------------- /src/iactivityexporter.cpp: -------------------------------------------------------------------------------- 1 | #include "iactivityexporter.h" 2 | 3 | 4 | IActivityExporter::IActivityExporter(QObject *parent) : 5 | QObject(parent) 6 | { 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/iactivityexporter.h: -------------------------------------------------------------------------------- 1 | #ifndef IACTIVITYEXPORTER_H 2 | #define IACTIVITYEXPORTER_H 3 | 4 | #include 5 | 6 | #include "activity.h" 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "iexporterconfig.h" 14 | 15 | class WatchExporters; 16 | 17 | class IActivityExporter : public QObject 18 | { 19 | Q_OBJECT 20 | protected: 21 | public: 22 | explicit IActivityExporter(QObject *parent = 0); 23 | 24 | // return name of exporter 25 | virtual QString name() const = 0; 26 | 27 | // return icon for exporter 28 | virtual QIcon icon() const = 0; 29 | 30 | // return true if setup actually has a dialog. 31 | virtual bool hasSetup() const = 0; 32 | 33 | // popup a dialog with setup for exporter. 34 | virtual void setup( QWidget * parent ) = 0; 35 | 36 | // return the current config object. 37 | virtual IExporterConfig & config() = 0; 38 | 39 | // create a config object for current activity type. 40 | virtual IExporterConfig * createConfig() = 0; 41 | 42 | signals: 43 | // fires when this activity is done exporting it's data. 44 | void exportFinished( bool success, QString message, QUrl url ); 45 | // fires when this activity is done setting up it's authentication data (if any) 46 | void setupFinished( IActivityExporter * exporter, bool success ); 47 | // fires when the settings have changed and need re-saving 48 | void settingsChanged(IActivityExporter * exporter); 49 | 50 | public slots: 51 | // call this when you need to export the activity. 52 | virtual void exportActivity( ActivityPtr activity ) = 0; 53 | 54 | }; 55 | typedef QSharedPointer IActivityExporterPtr; 56 | typedef QList IActivityExporterList; 57 | 58 | #endif // IACTIVITYEXPORTER_H 59 | -------------------------------------------------------------------------------- /src/icons/boxes37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/icons/boxes37.png -------------------------------------------------------------------------------- /src/icons/gears6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/icons/gears6.png -------------------------------------------------------------------------------- /src/icons/internet43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/icons/internet43.png -------------------------------------------------------------------------------- /src/icons/ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/icons/ok.png -------------------------------------------------------------------------------- /src/icons/test20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/icons/test20.png -------------------------------------------------------------------------------- /src/icons/time28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/icons/time28.png -------------------------------------------------------------------------------- /src/iexporterconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef IEXPORTERCONFIG_H 2 | #define IEXPORTERCONFIG_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class WatchExporters; 9 | 10 | class IExporterConfig 11 | { 12 | protected: 13 | void parseExportTag(QDomElement & element, const QString & idAttribute ); 14 | void writeExportTag( QDomDocument & document, QDomElement &element, const QString & idAttribute); 15 | 16 | void writeTag(QDomDocument & document, QDomElement &parentElement, const QString &tag, const QString & value); 17 | QString readTag(QDomElement &parentElement, const QString & tag, const QString & def = QString(), bool * usedDef = 0); 18 | 19 | void writeEncodedTag(QDomDocument & document, QDomElement &parentElement, const QString &tag, const QByteArray & value); 20 | QByteArray readEncodedTag(QDomElement & parentElement, const QString & tag, const QByteArray & def = QByteArray()); 21 | 22 | QByteArray scrambleToken(const QByteArray &sourceToken) const; 23 | QByteArray decodeToken(const QString &token) const; 24 | QString encodeToken(const QByteArray &token) const; 25 | public: 26 | IExporterConfig(const QString & serial); 27 | virtual ~IExporterConfig(); 28 | 29 | // return true if other is the same type AND it's config is exactly the same. 30 | virtual bool equals( const IExporterConfig * other ); 31 | 32 | // copy the settings object from other to this. 33 | virtual bool apply( const IExporterConfig * other ); 34 | 35 | // load the config from element. 36 | virtual bool loadConfig( QDomElement & element ) = 0; 37 | 38 | // update the config into document as child elements of element. 39 | virtual void updateConfig( QDomDocument & document, QDomElement & element ) = 0; 40 | 41 | // return true if this setting may be stored on the watch. 42 | virtual bool allowSaveOnWatch() const = 0; 43 | // return true if this should save in the "online" section of the XML. 44 | virtual bool isOnline() const = 0; 45 | 46 | // resets to defaults. 47 | virtual void reset(); 48 | 49 | // true if any of the config params have changed since last save. 50 | virtual bool changed(); 51 | virtual void setChanged( bool changed ); 52 | 53 | // true if the exporter is enabled. 54 | virtual bool isValid() const; 55 | virtual void setValid(bool valid); 56 | 57 | virtual bool isAutoOpen() const; 58 | virtual void setAutoOpen( bool autoOpen ); 59 | 60 | virtual QString serial() const; 61 | 62 | private: 63 | bool m_Changed; 64 | bool m_IsValid; 65 | bool m_IsAutoOpen; 66 | QString m_Serial; 67 | }; 68 | 69 | typedef QMap IExporterConfigMap; 70 | 71 | 72 | #endif // IEXPORTERCONFIG_H 73 | -------------------------------------------------------------------------------- /src/info28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/info28.png -------------------------------------------------------------------------------- /src/lap.h: -------------------------------------------------------------------------------- 1 | #ifndef LAP_H 2 | #define LAP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "trackpoint.h" 8 | 9 | class Lap 10 | { 11 | quint32 m_TotalSeconds; 12 | double m_Length; 13 | int m_Calories; 14 | int m_HeartBeats; // -1 if not present 15 | int m_MaxHeartBeats; // -1 if not present 16 | int m_Cadence; // -1 if not present. 17 | TrackPointList m_Points; 18 | 19 | 20 | 21 | 22 | public: 23 | Lap(); 24 | 25 | quint32 totalSeconds() const; 26 | void setTotalSeconds( quint32 totalSeconds ); 27 | 28 | double length() const; 29 | void setLength( double length ); 30 | 31 | int calories( ) const; 32 | void setCalories( int calories ); 33 | 34 | int heartBeats() const; 35 | void setHeartBeats( int heartBeats ); 36 | 37 | int maximumHeartBeats( ) const; 38 | void setMaximumHeartBeats( int maximumHeartBeats ); 39 | 40 | int cadence() const; 41 | void setCadence( int cadence ); 42 | 43 | void calcTotals(); 44 | 45 | TrackPointList & points(); 46 | 47 | QString toString() const; 48 | 49 | }; 50 | typedef QSharedPointerLapPtr; 51 | typedef QListLapList; 52 | 53 | #endif // LAP_H 54 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "qtsingleapplication.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "version.h" 16 | #include "settings.h" 17 | 18 | int main(int argc, char *argv[]) 19 | { 20 | SharedTools::QtSingleApplication a("ttwatcher",argc, argv); 21 | if ( a.isRunning( )) 22 | { 23 | a.sendMessage("focus_app"); 24 | return 0; 25 | } 26 | 27 | a.setApplicationName("TTWatcher"); 28 | a.setApplicationVersion(VER_FILEVERSION_STR); 29 | 30 | a.setQuitOnLastWindowClosed(false); 31 | 32 | QCommandLineParser parser; 33 | parser.setApplicationDescription("ttwatcher is a 3rd party application for managing your T.T. watch."); 34 | 35 | QCommandLineOption startHidden(QStringList() << "h" << "hidden", QCoreApplication::translate("main", "Startup in traybar with main window hidden.")); 36 | parser.addOption(startHidden); 37 | parser.process(a); 38 | 39 | Settings::get(); // create settings object. 40 | 41 | int result = 0; 42 | 43 | { 44 | // scope this so that everything is gone and we can destroy 45 | // settings at the end. 46 | MainWindow w; 47 | QObject::connect(&a, SIGNAL(messageReceived(QString,QObject*)), &w, SLOT(onMessage(QString))); 48 | QObject::connect(&a, SIGNAL(commitDataRequest(QSessionManager&)), &w, SLOT(onCommitDataRequest(QSessionManager&))); 49 | 50 | if ( !parser.isSet(startHidden) ) 51 | { 52 | w.show(); 53 | } 54 | result = a.exec(); 55 | } 56 | 57 | Settings::free(); 58 | return result; 59 | } 60 | -------------------------------------------------------------------------------- /src/man360.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/man360.png -------------------------------------------------------------------------------- /src/man360_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/man360_large.png -------------------------------------------------------------------------------- /src/mountain13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/mountain13.png -------------------------------------------------------------------------------- /src/order32.h: -------------------------------------------------------------------------------- 1 | #ifndef ORDER32_H 2 | #define ORDER32_H 3 | 4 | 5 | #include 6 | #include 7 | 8 | #if CHAR_BIT != 8 9 | #error "unsupported char size" 10 | #endif 11 | 12 | enum 13 | { 14 | O32_LITTLE_ENDIAN = 0x03020100ul, 15 | O32_BIG_ENDIAN = 0x00010203ul, 16 | O32_PDP_ENDIAN = 0x01000302ul 17 | }; 18 | 19 | static const union { unsigned char bytes[4]; uint32_t value; } o32_host_order = 20 | { { 0, 1, 2, 3 } }; 21 | 22 | #define O32_HOST_ORDER (o32_host_order.value) 23 | 24 | 25 | #endif // ORDER32_H 26 | -------------------------------------------------------------------------------- /src/qtlocalpeer.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms and 13 | ** conditions see http://www.qt.io/terms-conditions. For further information 14 | ** use the contact form at http://www.qt.io/contact-us. 15 | ** 16 | ** GNU Lesser General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser 18 | ** General Public License version 2.1 or version 3 as published by the Free 19 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 20 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 21 | ** following information to ensure the GNU Lesser General Public License 22 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 23 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, The Qt Company gives you certain additional 26 | ** rights. These rights are described in The Qt Company LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ****************************************************************************/ 30 | #include 31 | #include 32 | #include 33 | #include 34 | namespace SharedTools { 35 | class QtLocalPeer : public QObject 36 | { 37 | Q_OBJECT 38 | public: 39 | explicit QtLocalPeer(QObject *parent = 0, const QString &appId = QString()); 40 | bool isClient(); 41 | bool sendMessage(const QString &message, int timeout, bool block); 42 | QString applicationId() const 43 | { return id; } 44 | static QString appSessionId(const QString &appId); 45 | Q_SIGNALS: 46 | void messageReceived(const QString &message, QObject *socket); 47 | protected Q_SLOTS: 48 | void receiveConnection(); 49 | protected: 50 | QString id; 51 | QString socketName; 52 | QLocalServer* server; 53 | QtLockedFile lockFile; 54 | }; 55 | } // namespace SharedTools 56 | -------------------------------------------------------------------------------- /src/qtsingleapplication.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2015 The Qt Company Ltd. 4 | ** Contact: http://www.qt.io/licensing 5 | ** 6 | ** This file is part of Qt Creator. 7 | ** 8 | ** Commercial License Usage 9 | ** Licensees holding valid commercial Qt licenses may use this file in 10 | ** accordance with the commercial license agreement provided with the 11 | ** Software or, alternatively, in accordance with the terms contained in 12 | ** a written agreement between you and The Qt Company. For licensing terms and 13 | ** conditions see http://www.qt.io/terms-conditions. For further information 14 | ** use the contact form at http://www.qt.io/contact-us. 15 | ** 16 | ** GNU Lesser General Public License Usage 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser 18 | ** General Public License version 2.1 or version 3 as published by the Free 19 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and 20 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the 21 | ** following information to ensure the GNU Lesser General Public License 22 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and 23 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 | ** 25 | ** In addition, as a special exception, The Qt Company gives you certain additional 26 | ** rights. These rights are described in The Qt Company LGPL Exception 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 | ** 29 | ****************************************************************************/ 30 | #include 31 | QT_FORWARD_DECLARE_CLASS(QSharedMemory) 32 | namespace SharedTools { 33 | class QtLocalPeer; 34 | class QtSingleApplication : public QApplication 35 | { 36 | Q_OBJECT 37 | public: 38 | QtSingleApplication(const QString &id, int &argc, char **argv); 39 | ~QtSingleApplication(); 40 | bool isRunning(qint64 pid = -1); 41 | void setActivationWindow(QWidget* aw, bool activateOnMessage = true); 42 | QWidget* activationWindow() const; 43 | bool event(QEvent *event); 44 | QString applicationId() const; 45 | void setBlock(bool value); 46 | public Q_SLOTS: 47 | bool sendMessage(const QString &message, int timeout = 5000, qint64 pid = -1); 48 | void activateWindow(); 49 | Q_SIGNALS: 50 | void messageReceived(const QString &message, QObject *socket); 51 | void fileOpenRequest(const QString &file); 52 | private: 53 | QString instancesFileName(const QString &appId); 54 | qint64 firstPeer; 55 | QSharedMemory *instances; 56 | QtLocalPeer *pidPeer; 57 | QWidget *actWin; 58 | QString appId; 59 | bool block; 60 | }; 61 | } // namespace SharedTools 62 | -------------------------------------------------------------------------------- /src/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | heart254.png 4 | man360.png 5 | mountain13.png 6 | trail.png 7 | door9.png 8 | home10.png 9 | info28.png 10 | arrow68.png 11 | document4.png 12 | hard13.png 13 | watch_small.png 14 | folder250.png 15 | strava.png 16 | tcx.png 17 | settings20.png 18 | runkeeper.png 19 | save-file.png 20 | smashrunlogo.png 21 | 22 | 23 | 404.html 24 | strava.html 25 | runkeeper.html 26 | smashrun.html 27 | 28 | 29 | running32.png 30 | 31 | 32 | tiles.json 33 | 34 | 35 | empty_tile.png 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/runkeeper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TTWatcher / RunKeeper Authorization 4 | 5 | 6 | 7 | 8 |

Authorization Success

9 |
10 | 11 |

Your RunKeeper account has been registered with TTWatcher

12 |
13 | TTWatcher 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/runkeeper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/runkeeper.png -------------------------------------------------------------------------------- /src/runkeeper_auth.h.orig: -------------------------------------------------------------------------------- 1 | #ifndef RUNKEEPER_AUTH_H 2 | #define RUNKEEPER_AUTH_H 3 | 4 | /* 5 | * Rename this file to runkeeper_auth.h and fill in the 6 | * client ids you'd like to use. 7 | * 8 | */ 9 | 10 | #define RUNKEEPER_CLIENT_ID "" 11 | #define RUNKEEPER_CLIENT_SECRET "" 12 | 13 | #endif // STRAVA_AUTH_H 14 | -------------------------------------------------------------------------------- /src/runkeeperexporter.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNKEEPEREXPORTER_H 2 | #define RUNKEEPEREXPORTER_H 3 | 4 | #include "iactivityexporter.h" 5 | #include 6 | #include "runkeeperexporterconfig.h" 7 | 8 | class RunKeeperExporter : public IActivityExporter 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit RunKeeperExporter(const QString & serial, QObject *parent = 0); 13 | 14 | 15 | virtual QString name() const; 16 | virtual QIcon icon() const; 17 | virtual bool hasSetup() const; 18 | virtual void setup( QWidget * parent ); 19 | virtual IExporterConfig & config(); 20 | virtual IExporterConfig *createConfig(); 21 | public slots: 22 | virtual void exportActivity( ActivityPtr activity ); 23 | 24 | private: 25 | QNetworkAccessManager m_Manager; 26 | QIcon m_Icon; 27 | RunKeeperExporterConfig m_Config; 28 | static QString toRKDate( const QDateTime & date ); 29 | 30 | QByteArray m_AuthRedirectUrl; 31 | private slots: 32 | void onRequestFinished( QNetworkReply * reply ); 33 | private: 34 | void onActivityPosted( QNetworkReply * reply ); 35 | void onGetUserId( QNetworkReply * reply ); 36 | void onAuthRequest( QNetworkReply * reply ); 37 | }; 38 | typedef QSharedPointerRunKeeperExporterPtr; 39 | 40 | #endif // RUNKEEPEREXPORTER_H 41 | -------------------------------------------------------------------------------- /src/runkeeperexporterconfig.cpp: -------------------------------------------------------------------------------- 1 | #include "runkeeperexporterconfig.h" 2 | #include "watchexporters.h" 3 | 4 | RunKeeperExporterConfig::RunKeeperExporterConfig(const QString &serial) :IExporterConfig(serial) 5 | { 6 | } 7 | 8 | bool RunKeeperExporterConfig::equals(const IExporterConfig *other) 9 | { 10 | if ( !IExporterConfig::equals(other) ) 11 | { 12 | return false; 13 | } 14 | 15 | const RunKeeperExporterConfig * o = dynamic_cast(other); 16 | if ( !o ) 17 | { 18 | return false; 19 | } 20 | 21 | return o->m_AuthToken == m_AuthToken; 22 | } 23 | 24 | bool RunKeeperExporterConfig::apply(const IExporterConfig *other) 25 | { 26 | const RunKeeperExporterConfig * o = dynamic_cast(other); 27 | if ( !o ) 28 | { 29 | return false; 30 | } 31 | 32 | IExporterConfig::apply(other); 33 | m_AuthToken = o->m_AuthToken; 34 | return true; 35 | } 36 | 37 | bool RunKeeperExporterConfig::loadConfig(QDomElement & element) 38 | { 39 | parseExportTag(element, "RunKeeper"); 40 | m_AuthToken = readEncodedTag(element, "AuthToken"); 41 | setChanged(false); 42 | return true; 43 | } 44 | 45 | void RunKeeperExporterConfig::updateConfig(QDomDocument &document, QDomElement &element) 46 | { 47 | writeExportTag(document, element, "RunKeeper"); 48 | writeEncodedTag(document, element, "AuthToken", m_AuthToken); 49 | setChanged(false); 50 | } 51 | 52 | bool RunKeeperExporterConfig::allowSaveOnWatch() const 53 | { 54 | return true; 55 | } 56 | 57 | bool RunKeeperExporterConfig::isOnline() const 58 | { 59 | return true; 60 | } 61 | 62 | void RunKeeperExporterConfig::reset() 63 | { 64 | IExporterConfig::reset(); 65 | m_AuthToken.clear(); 66 | } 67 | 68 | void RunKeeperExporterConfig::setAuthToken(const QByteArray &authToken) 69 | { 70 | if ( m_AuthToken != authToken ) 71 | { 72 | m_AuthToken = authToken; 73 | setChanged(true); 74 | } 75 | } 76 | 77 | QByteArray RunKeeperExporterConfig::authToken() const 78 | { 79 | return m_AuthToken; 80 | } 81 | -------------------------------------------------------------------------------- /src/runkeeperexporterconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNKEEPEREXPORTERCONFIG_H 2 | #define RUNKEEPEREXPORTERCONFIG_H 3 | 4 | #include "iexporterconfig.h" 5 | 6 | 7 | class RunKeeperExporterConfig : public IExporterConfig 8 | { 9 | public: 10 | RunKeeperExporterConfig(const QString & serial); 11 | 12 | // return true if other is the same type AND it's config is exactly the same. 13 | virtual bool equals( const IExporterConfig * other ); 14 | 15 | // copy the settings object from other to this. 16 | virtual bool apply( const IExporterConfig * other ); 17 | 18 | // load the config from element. 19 | virtual bool loadConfig(QDomElement &element ); 20 | 21 | // update the config into document as child elements of element. 22 | virtual void updateConfig( QDomDocument & document, QDomElement & element ); 23 | 24 | // return true if this setting may be stored on the watch. 25 | virtual bool allowSaveOnWatch() const; 26 | // return true if this should save in the "online" section of the XML. 27 | virtual bool isOnline() const; 28 | 29 | // reset to default values. 30 | virtual void reset(); 31 | 32 | void setAuthToken( const QByteArray & authToken ); 33 | QByteArray authToken( ) const; 34 | 35 | private: 36 | QByteArray m_AuthToken; 37 | }; 38 | 39 | #endif // RUNKEEPEREXPORTERCONFIG_H 40 | -------------------------------------------------------------------------------- /src/running24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/running24.png -------------------------------------------------------------------------------- /src/running32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/running32.ico -------------------------------------------------------------------------------- /src/running32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/running32.png -------------------------------------------------------------------------------- /src/runningman.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/runningman.ico -------------------------------------------------------------------------------- /src/runningman2.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/runningman2.icns -------------------------------------------------------------------------------- /src/runningman512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/runningman512.png -------------------------------------------------------------------------------- /src/save-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/save-file.png -------------------------------------------------------------------------------- /src/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGS_H 2 | #define SETTINGS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class Settings : public QObject 9 | { 10 | Q_OBJECT 11 | explicit Settings(QObject *parent = 0); 12 | static Settings * gSettings; 13 | public: 14 | 15 | static Settings * get(); 16 | static void free(); 17 | 18 | QString tileUrl() const; 19 | void setTileUrl( const QString & tileUrl ); 20 | 21 | double lastLatitude() const; 22 | void setLastLatitude(double lastLatitude); 23 | double lastLongitude() const; 24 | void setLastLongitude(double lastLongitude); 25 | int lastZoom() const; 26 | void setLastZoom(int zoom); 27 | 28 | bool autoDownload() const; 29 | void setAutoDownload( bool download ); 30 | 31 | void setQuickFixDate( const QString & serial, QDateTime t ); 32 | QDateTime lastQuickFix( const QString & serial ); 33 | 34 | bool useMetric() const; 35 | void setUseMetric( bool useMetric ); 36 | 37 | bool useHighResolutionElevation() const; 38 | void setUseHighResolutionElevation(bool useHighRes ); 39 | 40 | QString watchDescriptor() const; 41 | void setWatchDescriptor(const QString & descriptor ); 42 | 43 | void save(); 44 | void load(); 45 | 46 | 47 | static QString ttdir(); 48 | signals: 49 | void tileUrlChanged( QString url ); 50 | void lastLatitudeChanged( double latitude ); 51 | void lastLongitudeChanged( double longitude ); 52 | void lastZoomChanged( int zoom ); 53 | void autoDownloadChanged( bool autoDownload ); 54 | void useMetricChanged(bool useMetric); 55 | void useHighResolutionElevationChanged(bool useHighRes); 56 | void watchDescriptorChanged(QString descriptor); 57 | 58 | private: 59 | QString m_TileUrl; 60 | double m_LastLatitude; 61 | double m_LastLongitude; 62 | int m_LastZoom; 63 | bool m_AutoDownload; 64 | bool m_UseMetric; 65 | QString m_WatchDescriptor; 66 | bool m_UseHighResElevation; 67 | 68 | QMap m_LastQuickFix; 69 | void saveQuickFix(); 70 | void loadQuickFix(); 71 | static QString preferenceDir(); 72 | static QString settingsFilename(); 73 | static QString quickFixFilename(); 74 | }; 75 | 76 | #endif // SETTINGS_H 77 | -------------------------------------------------------------------------------- /src/settings20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/settings20.png -------------------------------------------------------------------------------- /src/settingsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SETTINGSDIALOG_H 2 | #define SETTINGSDIALOG_H 3 | 4 | #include 5 | #include "ttmanager.h" 6 | #include "settings.h" 7 | 8 | namespace Ui { 9 | class SettingsDialog; 10 | } 11 | 12 | class SettingsDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | Settings * m_Settings; 16 | TTManager * m_TTManager; 17 | 18 | bool isStartOnLogin(); 19 | void setStartOnLogin(bool start); 20 | public: 21 | explicit SettingsDialog(Settings * settings, TTManager * ttManager, QWidget *parent = 0); 22 | ~SettingsDialog(); 23 | 24 | private slots: 25 | 26 | void on_exporterList_currentRowChanged(int currentRow); 27 | 28 | void on_watchBox_currentIndexChanged(int index); 29 | 30 | void onSetupFinished( IActivityExporter *exporter, bool success ); 31 | 32 | void onExporterChanged(); 33 | void onSettingChanged(); 34 | 35 | void on_setupButton_clicked(); 36 | 37 | void on_cancelButton_clicked(); 38 | 39 | void on_okButton_clicked(); 40 | 41 | void on_SettingsDialog_accepted(); 42 | 43 | void on_SettingsDialog_rejected(); 44 | 45 | private slots: 46 | void display(); 47 | 48 | void on_openElevationCacheButton_clicked(); 49 | 50 | private: 51 | Ui::SettingsDialog *ui; 52 | 53 | 54 | void displayWatchPreferences(); 55 | IActivityExporterPtr currentExporter(); 56 | }; 57 | 58 | #endif // SETTINGSDIALOG_H 59 | -------------------------------------------------------------------------------- /src/singleshot.cpp: -------------------------------------------------------------------------------- 1 | #include "singleshot.h" 2 | 3 | 4 | SingleShot::SingleShot(Callback cb, int ms, bool autoDelete, QObject *parent) : 5 | QObject(parent), 6 | m_AutoDelete(autoDelete), 7 | m_CB(cb) 8 | { 9 | connect(&m_Timer, SIGNAL(timeout()), this, SLOT(onTimeout()), Qt::QueuedConnection); 10 | m_Timer.setSingleShot(true); 11 | 12 | if ( ms > 0 ) 13 | { 14 | start(ms); 15 | } 16 | } 17 | 18 | void SingleShot::start(int ms) 19 | { 20 | m_Timer.start(ms); 21 | } 22 | 23 | 24 | void SingleShot::go(SingleShot::Callback cb, int ms, bool autoDelete, QObject *parent) 25 | { 26 | new SingleShot(cb,ms,autoDelete, parent); 27 | } 28 | 29 | void SingleShot::onTimeout() 30 | { 31 | if ( m_CB ) 32 | { 33 | m_CB(); 34 | } 35 | if ( m_AutoDelete ) 36 | { 37 | deleteLater(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/singleshot.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLESHOT_H 2 | #define SINGLESHOT_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | /* This class allows you to create a fire-and-forget QTimer::singleShot that 9 | * uses std::function. */ 10 | 11 | 12 | class SingleShot : public QObject 13 | { 14 | Q_OBJECT 15 | QTimer m_Timer; 16 | bool m_AutoDelete; 17 | 18 | public: 19 | 20 | typedef std::function< void() > Callback; 21 | explicit SingleShot(Callback cb, int ms = 0, bool autoDelete=true, QObject *parent = 0); 22 | void start( int ms ); 23 | 24 | static void go(Callback cb, int ms = 0, bool autoDelete=true, QObject *parent = 0); 25 | 26 | private slots: 27 | 28 | void onTimeout(); 29 | private: 30 | Callback m_CB; 31 | 32 | 33 | }; 34 | 35 | 36 | #endif // SINGLESHOT_H 37 | -------------------------------------------------------------------------------- /src/smashrun.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TTWatcher / Smashrun Authorization 4 | 5 | 6 | 7 | 8 |

Authorization Success

9 |
10 | 11 |

Your Smashrun account has been registered with TTWatcher

12 |
13 | TTWatcher 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/smashrun_auth.h.orig: -------------------------------------------------------------------------------- 1 | #ifndef STRAVA_AUTH_H 2 | #define STRAVA_AUTH_H 3 | 4 | /* 5 | * Rename this file to smashrun_auth.h and fill in the 6 | * client ids you'd like to use. 7 | * 8 | */ 9 | 10 | #define SMASHRUN_CLIENT_ID "" 11 | #define SMASHRUN_CLIENT_SECRET "" 12 | 13 | #endif // STRAVA_AUTH_H 14 | -------------------------------------------------------------------------------- /src/smashrunexporter.h: -------------------------------------------------------------------------------- 1 | #ifndef SMASHRUNEXPORTER_H 2 | #define SMASHRUNEXPORTER_H 3 | 4 | #include 5 | #include "iactivityexporter.h" 6 | #include "smashrunexporterconfig.h" 7 | 8 | class SmashrunExporter : public IActivityExporter 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit SmashrunExporter(const QString & serial, QObject *parent = 0); 13 | 14 | virtual QString name() const ; 15 | virtual QIcon icon() const; 16 | virtual bool hasSetup() const; 17 | virtual void setup( QWidget * parent ); 18 | virtual IExporterConfig & config(); 19 | IExporterConfig * createConfig(); 20 | 21 | public slots: 22 | virtual void exportActivity( ActivityPtr activity ); 23 | private slots: 24 | void requestFinished( QNetworkReply * reply ); 25 | 26 | private: 27 | QNetworkAccessManager m_Manager; 28 | QIcon m_Icon; 29 | SmashrunExporterConfig m_Config; 30 | ActivityPtr m_ActivityAfterRefresh; 31 | 32 | void refreshAuth(); 33 | void getUsername( QString activityId ); 34 | void activitySubmitted( QJsonDocument & d, int httpCode ); 35 | void authCodeAnswer( QJsonDocument & d, int httpCode ); 36 | void refreshCodeAnswer( QJsonDocument & d, int httpCode ); 37 | void getUsernameAnswer(QJsonDocument & d, int httpCode , QNetworkReply *reply); 38 | }; 39 | 40 | typedef QSharedPointerSmashrunExporterPtr; 41 | 42 | #endif // SMASHRUNEXPORTER_H 43 | -------------------------------------------------------------------------------- /src/smashrunexporterconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef SMASHRUNEXPORTERCONFIG_H 2 | #define SMASHRUNEXPORTERCONFIG_H 3 | 4 | #include 5 | #include "iexporterconfig.h" 6 | 7 | class SmashrunExporterConfig : public IExporterConfig 8 | { 9 | public: 10 | SmashrunExporterConfig(const QString & serial); 11 | 12 | // return true if other is the same type AND it's config is exactly the same. 13 | virtual bool equals( const IExporterConfig * other ); 14 | 15 | // copy the settings object from other to this. 16 | virtual bool apply( const IExporterConfig * other ); 17 | 18 | // load the config from element. 19 | virtual bool loadConfig(QDomElement &element ); 20 | 21 | // update the config into document as child elements of element. 22 | virtual void updateConfig(QDomDocument & document, QDomElement & element ); 23 | 24 | // return true if this setting may be stored on the watch. 25 | virtual bool allowSaveOnWatch() const; 26 | // return true if this should save in the "online" section of the XML. 27 | virtual bool isOnline() const; 28 | 29 | // resets to defaults. 30 | virtual void reset(); 31 | 32 | void setAuthToken( const QByteArray & authToken ); 33 | QByteArray authToken( ) const; 34 | void setRefreshToken(const QByteArray & refreshToken ); 35 | QByteArray refreshToken( ) const; 36 | void setLastRefresh( const QDateTime & lastRefresh ); 37 | QDateTime lastRefresh() const; 38 | 39 | private: 40 | QByteArray m_AuthToken; 41 | QByteArray m_RefreshToken; 42 | QDateTime m_LastRefresh; 43 | }; 44 | 45 | #endif // SMASHRUNEXPORTERCONFIG_H 46 | -------------------------------------------------------------------------------- /src/smashrunlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/smashrunlogo.png -------------------------------------------------------------------------------- /src/srtmelevationtile.h: -------------------------------------------------------------------------------- 1 | #ifndef SRTMELEVATIONTILE_H 2 | #define SRTMELEVATIONTILE_H 3 | 4 | #include "elevationtile.h" 5 | #include 6 | #include 7 | 8 | class SRTMElevationTile : public ElevationTile 9 | { 10 | Q_OBJECT 11 | QString m_Filename; 12 | QPointF m_BottomLeft; 13 | QPointF m_TopRight; 14 | QFile m_File; 15 | float m_ArcSeconds; 16 | double m_CellSize; 17 | int m_Rows; 18 | int m_Cols; 19 | quint64 m_Filesize; 20 | qint16 * m_Data; 21 | enum SRTMSet { UNKNOWN, SRTM1, SRTM3 }; 22 | SRTMSet m_Set; 23 | 24 | public: 25 | explicit SRTMElevationTile(const QString & filename, QObject *parent = 0); 26 | ~SRTMElevationTile(); 27 | 28 | virtual bool readHeader(); 29 | virtual bool open(); 30 | virtual void close(); 31 | virtual bool isOpen() const; 32 | virtual QPointF bottomLeft() const; 33 | virtual QPointF topRight() const; 34 | virtual bool contains( const QPointF & p ) const; 35 | virtual float arcSeconds() const; 36 | virtual bool elevation( const QPointF & p, float & elevation ) const; 37 | virtual bool removeFiles(); 38 | 39 | static ElevationSourceList dataSetURLs( const QPointF &p ); 40 | 41 | signals: 42 | 43 | public slots: 44 | 45 | }; 46 | 47 | #endif // SRTMELEVATIONTILE_H 48 | -------------------------------------------------------------------------------- /src/strava.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | TTWatcher / Strava Authorization 4 | 5 | 6 | 7 | 8 |

Authorization Success

9 |
10 | 11 |

Your Strava account has been registered with TTWatcher

12 |
13 | TTWatcher 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/strava.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/strava.png -------------------------------------------------------------------------------- /src/strava_auth.h.orig: -------------------------------------------------------------------------------- 1 | #ifndef STRAVA_AUTH_H 2 | #define STRAVA_AUTH_H 3 | 4 | /* 5 | * Rename this file to strava_auth.h and fill in the 6 | * client ids you'd like to use. 7 | * 8 | */ 9 | 10 | #define STRAVA_CLIENT_ID "" 11 | #define STRAVA_CLIENT_SECRET "" 12 | 13 | #endif // STRAVA_AUTH_H 14 | -------------------------------------------------------------------------------- /src/stravaexporter.h: -------------------------------------------------------------------------------- 1 | #ifndef STRAVAEXPORTER_H 2 | #define STRAVAEXPORTER_H 3 | 4 | #include "iactivityexporter.h" 5 | #include 6 | #include "stravaexporterconfig.h" 7 | 8 | class StravaExporter : public IActivityExporter 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit StravaExporter(const QString & serial, QObject *parent = 0); 14 | 15 | virtual QString name() const; 16 | virtual QIcon icon() const; 17 | virtual bool hasSetup() const; 18 | virtual void setup( QWidget * parent ); 19 | virtual IExporterConfig & config(); 20 | IExporterConfig *createConfig(); 21 | 22 | signals: 23 | 24 | public slots: 25 | virtual void exportActivity( ActivityPtr activity ); 26 | private slots: 27 | void requestFinished( QNetworkReply * reply ); 28 | 29 | private: 30 | QNetworkAccessManager m_Manager; 31 | QIcon m_Icon; 32 | StravaExporterConfig m_Config; 33 | 34 | void getActivityStatus(int activityId , int retry); 35 | void activitySubmitted( QJsonDocument & d, int httpCode ); 36 | void activityStatus(QJsonDocument &d, int httpCode , QNetworkReply *reply); 37 | void authCodeAnswer( QJsonDocument & d, int httpCode ); 38 | }; 39 | typedef QSharedPointerStravaExporterPtr; 40 | 41 | #endif // STRAVAEXPORTER_H 42 | -------------------------------------------------------------------------------- /src/stravaexporterconfig.cpp: -------------------------------------------------------------------------------- 1 | #include "stravaexporterconfig.h" 2 | #include "watchexporters.h" 3 | 4 | StravaExporterConfig::StravaExporterConfig(const QString &serial) :IExporterConfig(serial) 5 | { 6 | } 7 | 8 | bool StravaExporterConfig::equals(const IExporterConfig *other) 9 | { 10 | if ( !IExporterConfig::equals(other) ) 11 | { 12 | return false; 13 | } 14 | 15 | const StravaExporterConfig * o = dynamic_cast(other); 16 | if ( !o ) 17 | { 18 | return false; 19 | } 20 | 21 | return o->m_AuthToken == m_AuthToken; 22 | } 23 | 24 | bool StravaExporterConfig::apply(const IExporterConfig *other) 25 | { 26 | const StravaExporterConfig * o = dynamic_cast(other); 27 | if ( !o ) 28 | { 29 | return false; 30 | } 31 | 32 | IExporterConfig::apply(other); 33 | m_AuthToken = o->m_AuthToken; 34 | return true; 35 | } 36 | 37 | void StravaExporterConfig::reset() 38 | { 39 | IExporterConfig::reset(); 40 | m_AuthToken.clear(); 41 | } 42 | 43 | void StravaExporterConfig::setAuthToken(const QByteArray &authToken) 44 | { 45 | if ( m_AuthToken != authToken ) 46 | { 47 | m_AuthToken = authToken; 48 | setChanged(true); 49 | } 50 | } 51 | 52 | QByteArray StravaExporterConfig::authToken() const 53 | { 54 | return m_AuthToken; 55 | } 56 | 57 | bool StravaExporterConfig::isOnline() const 58 | { 59 | return true; 60 | } 61 | 62 | bool StravaExporterConfig::allowSaveOnWatch() const 63 | { 64 | return true; 65 | } 66 | 67 | void StravaExporterConfig::updateConfig(QDomDocument &document, QDomElement &element) 68 | { 69 | writeExportTag(document, element, "Strava"); 70 | writeEncodedTag(document, element, "StravaAuthToken", m_AuthToken); 71 | setChanged(false); 72 | } 73 | 74 | bool StravaExporterConfig::loadConfig(QDomElement & element) 75 | { 76 | parseExportTag(element, "Strava"); 77 | m_AuthToken = readEncodedTag(element, "StravaAuthToken"); 78 | setChanged(false); 79 | return true; 80 | } 81 | -------------------------------------------------------------------------------- /src/stravaexporterconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef STRAVAEXPORTERCONFIG_H 2 | #define STRAVAEXPORTERCONFIG_H 3 | 4 | #include 5 | #include "iexporterconfig.h" 6 | 7 | class StravaExporterConfig : public IExporterConfig 8 | { 9 | public: 10 | StravaExporterConfig(const QString & serial); 11 | 12 | // return true if other is the same type AND it's config is exactly the same. 13 | virtual bool equals( const IExporterConfig * other ); 14 | 15 | // copy the settings object from other to this. 16 | virtual bool apply( const IExporterConfig * other ); 17 | 18 | // load the config from element. 19 | virtual bool loadConfig(QDomElement &element ); 20 | 21 | // update the config into document as child elements of element. 22 | virtual void updateConfig(QDomDocument & document, QDomElement & element ); 23 | 24 | // return true if this setting may be stored on the watch. 25 | virtual bool allowSaveOnWatch() const; 26 | // return true if this should save in the "online" section of the XML. 27 | virtual bool isOnline() const; 28 | 29 | // reset to default values. 30 | virtual void reset(); 31 | 32 | void setAuthToken( const QByteArray & authToken ); 33 | QByteArray authToken( ) const; 34 | 35 | private: 36 | QByteArray m_AuthToken; 37 | 38 | }; 39 | 40 | #endif // STRAVAEXPORTERCONFIG_H 41 | -------------------------------------------------------------------------------- /src/tcx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/tcx.png -------------------------------------------------------------------------------- /src/tcxactivityexporter.cpp: -------------------------------------------------------------------------------- 1 | #include "tcxactivityexporter.h" 2 | #include "tcxexport.h" 3 | #include 4 | #include "watchexporters.h" 5 | 6 | TCXActivityExporter::TCXActivityExporter(const QString &serial, QObject *parent) : 7 | IActivityExporter(parent), 8 | m_Icon(":/icons/tcx.png"), 9 | m_Config(serial) 10 | { 11 | } 12 | 13 | QString TCXActivityExporter::name() const 14 | { 15 | return "TCX"; 16 | } 17 | 18 | QIcon TCXActivityExporter::icon() const 19 | { 20 | return m_Icon; 21 | } 22 | 23 | bool TCXActivityExporter::hasSetup() const 24 | { 25 | return false; 26 | } 27 | 28 | void TCXActivityExporter::setup(QWidget *parent) 29 | { 30 | Q_UNUSED(parent); 31 | } 32 | 33 | IExporterConfig &TCXActivityExporter::config() 34 | { 35 | return m_Config; 36 | } 37 | 38 | IExporterConfig * TCXActivityExporter::createConfig() 39 | { 40 | return new TCXExporterConfig( m_Config.serial() ); 41 | } 42 | 43 | 44 | void TCXActivityExporter::exportActivity(ActivityPtr activity) 45 | { 46 | if ( !activity ) 47 | { 48 | return; 49 | } 50 | 51 | TCXExport e; 52 | 53 | QFile f( activity->filename() + ".tcx"); 54 | if ( !f.open(QIODevice::WriteOnly|QIODevice::Truncate) ) 55 | { 56 | emit exportFinished(false, tr("TCX: Could not write file %1.").arg(f.fileName()), QUrl()); 57 | return; 58 | } 59 | 60 | e.save(&f, activity); 61 | f.close(); 62 | emit exportFinished(true, tr("TCX: Export success."), QUrl::fromLocalFile( f.fileName() )); 63 | } 64 | -------------------------------------------------------------------------------- /src/tcxactivityexporter.h: -------------------------------------------------------------------------------- 1 | #ifndef TCXACTIVITYEXPORTER_H 2 | #define TCXACTIVITYEXPORTER_H 3 | 4 | #include "iactivityexporter.h" 5 | #include "tcxexporterconfig.h" 6 | 7 | class TCXActivityExporter : public IActivityExporter 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit TCXActivityExporter(const QString & serial, QObject *parent = 0); 12 | 13 | virtual QString name() const; 14 | virtual QIcon icon() const; 15 | virtual bool hasSetup() const; 16 | virtual void setup( QWidget * parent ); 17 | virtual IExporterConfig & config(); 18 | IExporterConfig *createConfig(); 19 | 20 | public slots: 21 | virtual void exportActivity( ActivityPtr activity ); 22 | private: 23 | QIcon m_Icon; 24 | TCXExporterConfig m_Config; 25 | }; 26 | typedef QSharedPointerTCXActivityExporterPtr; 27 | 28 | #endif // TCXACTIVITYEXPORTER_H 29 | -------------------------------------------------------------------------------- /src/tcxexport.h: -------------------------------------------------------------------------------- 1 | #ifndef TCXEXPORT_H 2 | #define TCXEXPORT_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | #include "activity.h" 9 | 10 | class TCXExport 11 | { 12 | public: 13 | TCXExport(); 14 | 15 | void save( QIODevice * dev, ActivityPtr activity ); 16 | }; 17 | 18 | #endif // TCXEXPORT_H 19 | -------------------------------------------------------------------------------- /src/tcxexporterconfig.cpp: -------------------------------------------------------------------------------- 1 | #include "tcxexporterconfig.h" 2 | 3 | TCXExporterConfig::TCXExporterConfig(const QString &serial) : IExporterConfig(serial) 4 | { 5 | } 6 | 7 | bool TCXExporterConfig::loadConfig( QDomElement & element) 8 | { 9 | parseExportTag(element, "TCX"); 10 | setChanged(false); 11 | return true; 12 | } 13 | 14 | void TCXExporterConfig::updateConfig( QDomDocument &document, QDomElement &element) 15 | { 16 | writeExportTag(document, element, "TCX"); 17 | setChanged(false); 18 | } 19 | 20 | bool TCXExporterConfig::allowSaveOnWatch() const 21 | { 22 | return true; 23 | } 24 | 25 | bool TCXExporterConfig::isOnline() const 26 | { 27 | return false; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/tcxexporterconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef TCXEXPORTERCONFIG_H 2 | #define TCXEXPORTERCONFIG_H 3 | 4 | #include "iexporterconfig.h" 5 | 6 | class TCXExporterConfig : public IExporterConfig 7 | { 8 | public: 9 | TCXExporterConfig(const QString & serial); 10 | 11 | // load the config from element. 12 | virtual bool loadConfig( QDomElement & element ); 13 | 14 | // update the config into document as child elements of element. 15 | virtual void updateConfig( QDomDocument & document, QDomElement & element ); 16 | 17 | // return true if this setting may be stored on the watch. 18 | virtual bool allowSaveOnWatch() const; 19 | // return true if this should save in the "online" section of the XML. 20 | virtual bool isOnline() const; 21 | }; 22 | 23 | #endif // TCXEXPORTERCONFIG_H 24 | -------------------------------------------------------------------------------- /src/tiles.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Street", 4 | "url": "http://otile1.mqcdn.com/tiles/1.0.0/map/%1/%2/%3.png", 5 | "copyright" : "© OpenStreetMap contributors" 6 | }, 7 | { 8 | "name": "Satellite", 9 | "url": "http://otile1.mqcdn.com/tiles/1.0.0/sat/%1/%2/%3.png", 10 | "copyright" : "Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency" 11 | }, 12 | { 13 | "name": "OpenStreetMap", 14 | "url": "http://tile.openstreetmap.org/%1/%2/%3.png", 15 | "copyright" : "© OpenStreetMap contributors" 16 | }, 17 | { 18 | "name": "Open Cycle Map", 19 | "url": "http://a.tile.opencyclemap.org/cycle/%1/%2/%3.png", 20 | "copyright" : "© OpenStreetMap contributors" 21 | }, 22 | { 23 | "name": "Hike and Bike Map", 24 | "url": "http://a.tiles.wmflabs.org/hikebike/%1/%2/%3.png", 25 | "copyright" : "© OpenStreetMap contributors" 26 | }, 27 | { 28 | "name": "Stamen Water Color", 29 | "url": "http://a.tile.stamen.com/watercolor/%1/%2/%3.jpg", 30 | "copyright" : "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA" 31 | } 32 | 33 | ] 34 | -------------------------------------------------------------------------------- /src/trackpoint.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACKPOINT_H 2 | #define TRACKPOINT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class TrackPoint 11 | { 12 | QDateTime m_Time; 13 | QPointF m_Coordinate; 14 | double m_Altitude; 15 | int m_HeartRate; 16 | int m_Cadence; 17 | int m_Calories; 18 | float m_CummulativeDistance; 19 | double m_Speed; 20 | 21 | public: 22 | TrackPoint(); 23 | 24 | 25 | QDateTime time() const; 26 | void setTime(const QDateTime &time); 27 | double latitude() const; 28 | void setLatitude(double latitude); 29 | double longitude() const; 30 | void setLongitude(double longitude); 31 | double altitude() const; 32 | void setAltitude(double altitude); 33 | int heartRate() const; 34 | void setHeartRate(int heartRate); 35 | int cadence() const; 36 | void setCadence(int cadence); 37 | int calories() const; 38 | void setCalories(int calories); 39 | float cummulativeDistance() const; 40 | void setCummulativeDistance(float cummulativeDistance); 41 | 42 | void setSpeed( double speed ); 43 | double speed() const; 44 | 45 | bool hasGPS(); 46 | 47 | QString toString() const; 48 | const QPointF & coordinate() const; 49 | }; 50 | typedef QSharedPointerTrackPointPtr; 51 | typedef QListTrackPointList; 52 | #endif // TRACKPOINT_H 53 | -------------------------------------------------------------------------------- /src/trail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/trail.png -------------------------------------------------------------------------------- /src/ttbinreader.h: -------------------------------------------------------------------------------- 1 | #ifndef TTBINREADER_H 2 | #define TTBINREADER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "activity.h" 10 | 11 | class TTBinReader 12 | { 13 | QMap m_RecordLengths; 14 | qint32 m_UTCOffset; 15 | 16 | 17 | bool readData( QIODevice & ttbin, quint8 tag, int expectedSize, QByteArray & dest ); 18 | bool readHeader( QIODevice & ttbin, ActivityPtr activity, QByteArray * cpy = 0 ); 19 | bool readStatus( QIODevice & ttbin, ActivityPtr activity ); 20 | bool readLap(QIODevice & ttbin, ActivityPtr activity ); 21 | bool readHeartRate( QIODevice & ttbin, ActivityPtr activity ); 22 | bool readPosition( QIODevice & ttbin, ActivityPtr activity, bool forgiving ); 23 | bool readSummary( QIODevice & ttbin, ActivityPtr activity ); 24 | bool readTreadmill( QIODevice & ttbin, ActivityPtr activity ); 25 | bool readSwim( QIODevice & ttbin, ActivityPtr activity ); 26 | bool readAltitude( QIODevice & ttbin, ActivityPtr activity ); 27 | bool readRecovery(QIODevice &ttbin, ActivityPtr activity); 28 | 29 | bool skipTag(QIODevice & ttbin, quint8 tag, int size , QByteArray *cpy = 0); 30 | 31 | public: 32 | TTBinReader(); 33 | 34 | 35 | 36 | 37 | ActivityPtr read( QIODevice & ttbin, bool forgiving = false, bool headerAndSummaryOnly = false ); 38 | ActivityPtr read( const QString &filename, bool forgiving = false, bool headerAndSummaryOnly = false ); 39 | 40 | 41 | static quint16 readquint16(const quint8 * data, int pos ); 42 | static quint32 readquint32(const quint8 * data, int pos ); 43 | static qint16 readqint16(const quint8 *data, int pos); 44 | static qint32 readqint32(const quint8 * data, int pos ); 45 | static QDateTime readTime(const quint8 * data, int pos , bool inUTC); 46 | static float readFloat(const quint8 * data, int pos ); 47 | 48 | 49 | bool updateActivityType(QIODevice &ttbin, bool forgiving, QIODevice &output, Activity::Sport newSport); 50 | private: 51 | 52 | 53 | }; 54 | 55 | int process(const QString &filename); 56 | 57 | #endif // TTBINREADER_H 58 | -------------------------------------------------------------------------------- /src/ttmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef TTMANAGER_H 2 | #define TTMANAGER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "ttwatch.h" 8 | #include "watchexporters.h" 9 | 10 | typedef QList DeviceIdList; 11 | typedef QList TTWatchList; 12 | typedef QMap WatchExportersMap; 13 | 14 | class TTManager : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | TTWatchList m_TTWatchList; 19 | WatchExportersMap m_WatchExporters; 20 | void checkvds(quint16 vid, const DeviceIdList & deviceIds ); 21 | void prepareWatch ( TTWatch * watch ); 22 | 23 | TTWatch * find( const QString & path ); 24 | bool remove( const QString & path ); 25 | public: 26 | 27 | explicit TTManager(QObject *parent = 0); 28 | virtual ~TTManager(); 29 | void startSearch(); 30 | const TTWatchList & watches(); 31 | TTWatch * watch( const QString & serial ); 32 | 33 | WatchExportersMap &exporters(); 34 | WatchExportersPtr exporters( const QString & serial ); 35 | WatchExportersPtr exportersForName ( const QString & name ); 36 | WatchExportersPtr defaultExporters(); 37 | 38 | 39 | void saveConfig(QIODevice * dest, WatchExportersPtr watchExporters ); 40 | bool loadConfig(QIODevice * source, const IExporterConfigMap & configMap, QString & name); 41 | 42 | void saveConfig(const QString & filename, WatchExportersPtr watchExporters ); 43 | bool loadConfig(const QString & filename, const IExporterConfigMap & configMap, QString & name); 44 | 45 | void saveConfig(QByteArray & dest, WatchExportersPtr watchExporters ); 46 | bool loadConfig(const QByteArray & source, const IExporterConfigMap & configMap, QString & name); 47 | 48 | void saveConfig(WatchExportersPtr watchExporters); 49 | 50 | // merge config for storing back on watch 51 | // this only saves configs that allow to be stored on phone. 52 | QByteArray mergeConfig( const QByteArray & source, const IExporterConfigMap & configMap ); 53 | 54 | void saveAllConfig( bool saveToWatch, const QString serialOnly = QString() ); 55 | void loadAllConfig( ); 56 | 57 | QString configDir() const; 58 | 59 | signals: 60 | 61 | void ttArrived(QString serial); 62 | void ttRemoved(QString serial); 63 | void allExportingFinished(); // this gets fired for each WatchPreferences object, so while one watch might be done, not all of them could. 64 | void exportError( QString error ); 65 | 66 | public slots: 67 | 68 | void checkForTTs(); 69 | 70 | private slots: 71 | void configChanged( QString serial ); 72 | 73 | }; 74 | 75 | #endif // TTMANAGER_H 76 | -------------------------------------------------------------------------------- /src/ttwatcher.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "runningman.ico" 2 | 3 | #include 4 | #include "version.h" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION VER_FILEVERSION 8 | PRODUCTVERSION VER_FILEVERSION 9 | BEGIN 10 | BLOCK "StringFileInfo" 11 | BEGIN 12 | BLOCK "040904E4" 13 | BEGIN 14 | VALUE "CompanyName", "" 15 | VALUE "FileDescription", "" 16 | VALUE "FileVersion", VER_FILEVERSION_STR 17 | VALUE "InternalName", "" 18 | VALUE "LegalCopyright", "" 19 | VALUE "LegalTrademarks1", "" 20 | VALUE "LegalTrademarks2", "" 21 | VALUE "OriginalFilename", "ttwatcher.exe" 22 | VALUE "ProductName", "TTWatcher" 23 | VALUE "ProductVersion", VER_FILEVERSION_STR 24 | END 25 | END 26 | 27 | BLOCK "VarFileInfo" 28 | BEGIN 29 | VALUE "Translation", 0x409, 1252 30 | END 31 | END 32 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | #define VER_FILEVERSION 2,0,1,0 2 | #define VER_FILEVERSION_STR "2.0.1" 3 | -------------------------------------------------------------------------------- /src/watch_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/watch_large.png -------------------------------------------------------------------------------- /src/watch_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altera2015/ttwatcher/01adeab31e7615a28139a4cf3bd041f07775454d/src/watch_small.png -------------------------------------------------------------------------------- /src/watchexporters.h: -------------------------------------------------------------------------------- 1 | #ifndef WATCHEXPORTERS_H 2 | #define WATCHEXPORTERS_H 3 | 4 | #include 5 | #include 6 | #include "iactivityexporter.h" 7 | 8 | class TTWatch; 9 | 10 | class WatchExporters : public QObject 11 | { 12 | Q_OBJECT 13 | public: 14 | explicit WatchExporters(const QString & serial, QObject *parent = 0); 15 | 16 | QString name() const; 17 | void setName( const QString & name ); 18 | QString serial() const; 19 | 20 | IActivityExporterList exporters(); 21 | IActivityExporterPtr exporter( const QString & service ); 22 | 23 | // do NOT free the returned objects. they are owned by this object. 24 | const IExporterConfigMap configMap(); 25 | 26 | // you must call freeImportMap on this puppy. 27 | IExporterConfigMap configImportMap(); 28 | void freeImportMap(IExporterConfigMap & map); 29 | 30 | bool exportActivity(ActivityPtr activity, const QString &exporterName = "", QStringList *sl = 0); 31 | bool exportFile(const QString &filename); 32 | bool isExporting(); 33 | 34 | signals: 35 | void exportFinished( bool success, QString message, QUrl url ); 36 | void allExportsFinished(); 37 | void exportError( QString error ); 38 | void settingsChanged( QString serial ); 39 | public slots: 40 | private slots: 41 | void onSettingsChanged(); 42 | void onExportFinished(bool success, QString message, QUrl url); 43 | 44 | private: 45 | 46 | QString m_Name; 47 | QString m_Serial; 48 | int m_ExportFinishedCounter; 49 | IActivityExporterList m_Exporters; 50 | }; 51 | typedef QSharedPointerWatchExportersPtr; 52 | 53 | #endif // WATCHEXPORTERS_H 54 | --------------------------------------------------------------------------------