Last active
November 20, 2018 22:08
-
-
Save pestophagous/8efbfcde8539c0af3dcea5f46e2cf46d to your computer and use it in GitHub Desktop.
mybuild_qmlfmt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/jesperhh/qmlfmt.git | |
cd qmlfmt | |
git checkout 942200d | |
use to_apply_to_942200d.patch # so it will compile with qt 5.8.0 | |
using "our customer's copy" of qt, which is qt 5.8.0 | |
got a cmake error about not finding "platformthemes/libqgtk3.so" | |
to work around the libqgtk3 error: open this file: third_party/qtproject/gcc_64/lib/cmake/Qt5Gui/Qt5Gui_QGtk3ThemePlugin.cmake --> and just COMMENT OUT the entire contents | |
mkdir build | |
cd build | |
cmake -DCMAKE_PREFIX_PATH=/home/someone/hello/fillthisin/yourway/third_party/qtproject/gcc_64/ .. | |
make | |
942200d 2018-03-29 Jesper Hellesø Hansen (HEAD -> master, tag: 1.0.71, origin/master, origin/HEAD) Refactoring, multi-file support and test coverage (#12) | |
4a1bc9b 2018-03-28 P M (tag: 1.0.66) Print error messages to stderr instead of stdout (#11) | |
243aae2 2018-03-18 Jesper Hellesø Hansen (tag: 1.0.62) Implement suggestions from pylipp and upgrade Qt & Qt Creator (#10) | |
4d4399c 2017-05-17 Jesper Hellesø Hansen (tag: 1.0.39) Merge pull request #7 from jesperhh/qt58 | |
4fcfb83 2017-05-17 Jesper Hellesø Hansen (tag: 1.0.36) Compile testrunner with C++11 with GCC | |
fb81410 2017-05-17 Jesper Hellesø Hansen Update travis build to use Qt 5.8 | |
290afbd 2016-09-23 Jesper Hellesø Hansen (tag: 1.0.33) Fix unit tests | |
15e2216 2016-09-23 Jesper Hellesø Hansen (tag: 1.0.28) Use CTest target to run tests | |
d4f56a7 2016-09-23 Jesper Hellesø Hansen (tag: 1.0.26) Fix GCC build (missing make_unique in C++11) | |
c083a90 2016-09-22 Jesper Hellesø Hansen (tag: 1.0.24) Add test runner and tests | |
b268fc0 2016-09-14 Jesper Hellesø Hansen (tag: 1.0.22) Add BSD license to all files | |
95cd772 2016-09-14 Jesper Hellesø Hansen Fixes #5 issue where uninitialized ModelManagerInterface singleton caused crashes when using QRC imports. | |
9f00765 2016-08-24 Jesper Hellesø Hansen (tag: 1.0.20) Deploy binary in compressed form | |
84c9859 2016-08-24 Jesper Hellesø Hansen (tag: 1.0.18) Update github token for travis | |
d017382 2016-08-23 Jesper Hellesø Hansen (tag: 1.0.16) Update token for travis | |
7030ab2 2016-08-23 Jesper Hellesø Hansen (tag: 1.0.13) Update CMake PPA | |
af58fc9 2016-08-23 Jesper Hellesø Hansen (tag: 1.0.12) Add Qt install to travis build script | |
a6da974 2016-08-23 Jesper Hellesø Hansen (tag: 1.0.10) Add travis build configuration | |
e8b05bf 2016-08-23 Jesper Hellesø Hansen (tag: 1.0.8) Change download link for Qt Creator sources from HTTP to HTTPS | |
196e481 2016-08-23 Michael Yang download link: http -> https | |
e0f7ec7 2016-08-12 Jesper Hellesø Hansen (tag: 1.0.5) Ignore warning 6011 from Qt | |
503a0be 2016-08-11 Jesper Hellesø Hansen Update to support Qt Creator 4.0. Remove hardcoded paths to Qt installation. | |
a15a722 2016-08-11 Jesper Hellesø Hansen Merge pull request #2 from Warezovvv/master | |
742c8d4 2016-08-11 Nikita Krupitskas Now it assembling properly | |
f69b447 2016-08-10 Jesper Hellesø Hansen Use correct case for build configuration type to fix Linux build. Fixes #1 | |
58bf170 2015-01-24 Jesper Hellesø Hansen Update README.md | |
a5182a4 2015-01-24 Jesper Hellesø Hansen Update README.md | |
9e304d2 2015-01-24 Jesper Hellesø Hansen Allow compilation with mingw | |
f92b421 2015-01-23 Jesper Hellesø Hansen Update README.md | |
7302685 2015-01-23 Jesper Hellesø Hansen Create README.md | |
598e393 2015-01-23 Jesper Hellesø Hansen fix compile warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
qmlfmt_symlink -w "$@" | |
# https://unix.stackexchange.com/a/47210/11592 | |
sed -i 'h;s/[^ ].*//;s/ / /g;G;s/\n *//' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/main.cpp b/main.cpp | |
index 4e86b66..14cff62 100644 | |
--- a/main.cpp | |
+++ b/main.cpp | |
@@ -98,10 +98,17 @@ int main(int argc, char *argv[]) | |
} | |
QmlFmt::Options options; | |
- for (auto kvp = optionMap.constKeyValueBegin(); kvp != optionMap.constKeyValueEnd(); ++kvp) | |
- { | |
- if (parser.isSet((*kvp).second)) | |
- options |= (*kvp).first; | |
+ // for (auto kvp = optionMap.constKeyValueBegin(); kvp != optionMap.constKeyValueEnd(); ++kvp) | |
+ // { | |
+ // if (parser.isSet((*kvp).second)) | |
+ // options |= (*kvp).first; | |
+ // } | |
+ | |
+ QMapIterator<QmlFmt::Option, QCommandLineOption> kvp_iter(optionMap); | |
+ while (kvp_iter.hasNext()) { | |
+ kvp_iter.next(); | |
+ if (parser.isSet(kvp_iter.value())) | |
+ options |= kvp_iter.key(); | |
} | |
QmlFmt qmlFmt(options); | |
diff --git a/qmlfmt.h b/qmlfmt.h | |
index 096d126..63e921a 100644 | |
--- a/qmlfmt.h | |
+++ b/qmlfmt.h | |
@@ -26,6 +26,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
*/ | |
+#include <QIODevice> | |
#include <QString> | |
class QmlFmt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment