From 17b5c15ab4d5152c8dd3591e3b5c4fad36f2782a Mon Sep 17 00:00:00 2001 From: Jacob Dawid Date: Tue, 3 Feb 2015 09:14:30 +0100 Subject: [PATCH 1/6] Made qt-pods compatible. --- LICENSE | 22 +++++++++++++++++++ README => README.md | 0 ...EncodedString.cpp => htmlencodedstring.cpp | 0 HtmlEncodedString.h => htmlencodedstring.h | 0 qthtmlencodedstring.pri | 1 + qthtmlencodedstring.pro | 10 +++++++++ 6 files changed, 33 insertions(+) create mode 100644 LICENSE rename README => README.md (100%) rename HtmlEncodedString.cpp => htmlencodedstring.cpp (100%) rename HtmlEncodedString.h => htmlencodedstring.h (100%) create mode 100644 qthtmlencodedstring.pri create mode 100644 qthtmlencodedstring.pro diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2e90774 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +Gist: this is an MIT license. Act accordingly (basically, do whatever you want). +It would be nice to get an email from you if you use this, but if not that's also cool. + +Copyright (c) 2010 Reilly Watson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README.md similarity index 100% rename from README rename to README.md diff --git a/HtmlEncodedString.cpp b/htmlencodedstring.cpp similarity index 100% rename from HtmlEncodedString.cpp rename to htmlencodedstring.cpp diff --git a/HtmlEncodedString.h b/htmlencodedstring.h similarity index 100% rename from HtmlEncodedString.h rename to htmlencodedstring.h diff --git a/qthtmlencodedstring.pri b/qthtmlencodedstring.pri new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/qthtmlencodedstring.pri @@ -0,0 +1 @@ + diff --git a/qthtmlencodedstring.pro b/qthtmlencodedstring.pro new file mode 100644 index 0000000..75aee3b --- /dev/null +++ b/qthtmlencodedstring.pro @@ -0,0 +1,10 @@ +TEMPLATE = lib + +CONFIG += staticlib +TARGET = qthtmlencodedstring + +SOURCES += \ + htmlencodedstring.cpp + +HEADERS += \ + htmlencodedstring.h From 187034973a4ea813c578c48385e02e9abc2fe70e Mon Sep 17 00:00:00 2001 From: Jacob Dawid Date: Tue, 3 Feb 2015 09:16:30 +0100 Subject: [PATCH 2/6] Extended README. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 7359417..0b55580 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +# Usage HTML encode QStrings. You can use it like so: HtmlEncodedString("mywackyunencodedinput"), or like so: HtmlEncodedString::encodeString("mywackyunencodedinput"). That's really about all there is to it. + +# How to install + +qthtmlencodedstring is available via qt-pods. See here for reference: +https://github.com/cybercatalyst/qt-pods + +Alternatively, you can just copy the files into your source tree. They don't have any dependencies beyond Qt Core. + From 704ce46aa78907b02cceabd55da567b1be400ea3 Mon Sep 17 00:00:00 2001 From: Jacob Dawid Date: Tue, 3 Feb 2015 09:21:40 +0100 Subject: [PATCH 3/6] Fixed repo name. --- qthtmlencodedstring.pri => qthtmlencode.pri | 0 qthtmlencodedstring.pro => qthtmlencode.pro | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename qthtmlencodedstring.pri => qthtmlencode.pri (100%) rename qthtmlencodedstring.pro => qthtmlencode.pro (80%) diff --git a/qthtmlencodedstring.pri b/qthtmlencode.pri similarity index 100% rename from qthtmlencodedstring.pri rename to qthtmlencode.pri diff --git a/qthtmlencodedstring.pro b/qthtmlencode.pro similarity index 80% rename from qthtmlencodedstring.pro rename to qthtmlencode.pro index 75aee3b..2677b98 100644 --- a/qthtmlencodedstring.pro +++ b/qthtmlencode.pro @@ -1,7 +1,7 @@ TEMPLATE = lib CONFIG += staticlib -TARGET = qthtmlencodedstring +TARGET = qthtmlencode SOURCES += \ htmlencodedstring.cpp From 693b1af555ef696961eb87c5ce9831d7b4f85165 Mon Sep 17 00:00:00 2001 From: Jacob Dawid Date: Tue, 3 Feb 2015 09:28:18 +0100 Subject: [PATCH 4/6] Fixed sources. --- htmlencodedstring.cpp | 5 ++++- htmlencodedstring.h | 10 ++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htmlencodedstring.cpp b/htmlencodedstring.cpp index b1efa99..4070662 100644 --- a/htmlencodedstring.cpp +++ b/htmlencodedstring.cpp @@ -1,4 +1,7 @@ -#include "HtmlEncodedString.h" +// Own includes +#include "htmlencodedstring.h" + +// Qt includes #include #include diff --git a/htmlencodedstring.h b/htmlencodedstring.h index 806dd03..7ac333d 100644 --- a/htmlencodedstring.h +++ b/htmlencodedstring.h @@ -1,12 +1,10 @@ -#ifndef __HTML_ENCODED_STRING_H__ -#define __HTML_ENCODED_STRING_H__ +#pragma once +// Qt includes #include -class HtmlEncodedString : public QString -{ +class HtmlEncodedString : public QString { public: - HtmlEncodedString (const QString& text); + HtmlEncodedString(const QString& text); static QString encodedString(const QString& text); }; -#endif From ca5507b6791d90e556f3d67cefdd6524e0e762f4 Mon Sep 17 00:00:00 2001 From: Jacob Dawid Date: Sat, 7 Feb 2015 10:56:28 +0100 Subject: [PATCH 5/6] Update qthtmlencode.pri --- qthtmlencode.pri | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qthtmlencode.pri b/qthtmlencode.pri index 8b13789..90e139d 100644 --- a/qthtmlencode.pri +++ b/qthtmlencode.pri @@ -1 +1,5 @@ +INCLUDEPATH += \ + $$PWD +LIBS += \ + -L../qthtmlencode -lqthtmlencode From 595b3ceadd5f110bb2b2bd59610afbaf63de97ad Mon Sep 17 00:00:00 2001 From: Jacob Dawid Date: Sat, 7 Feb 2015 18:38:58 +0100 Subject: [PATCH 6/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0b55580..a3f67f5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Qt Pods](http://qt-pods.org/assets/logo.png "Qt Pods")](http://qt-pods.org) + # Usage HTML encode QStrings. You can use it like so: HtmlEncodedString("mywackyunencodedinput"), or like so: HtmlEncodedString::encodeString("mywackyunencodedinput").