diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2010-11-17 16:22:00 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2010-11-17 16:22:00 +0100 |
commit | 79aad2eb87de71e4503b108e2cf9c56e25707565 (patch) | |
tree | cf05b3508b075a0b9677ce29c344ccd5843c06f7 /src/plugins/cpaster/pastebindotcomprotocol.cpp | |
parent | 71d98970cf7d1b008d24f0a067084a6c4d010d7e (diff) |
CodePaster: Fix listing of pastebin.com.
Skip multiple left-boxes (mobile section).
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
Rubber-stamped-by: dt
Task-number: QTCREATORBUG-3118
Diffstat (limited to 'src/plugins/cpaster/pastebindotcomprotocol.cpp')
-rw-r--r-- | src/plugins/cpaster/pastebindotcomprotocol.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp index 3c2349fbdf..127b8edeba 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp @@ -250,7 +250,8 @@ static inline void padString(QString *s, int len) static inline QStringList parseLists(QIODevice *io) { - enum State { OutsideRecentPostList, InsideRecentPostBox, InsideRecentPost }; + enum State { OutsideRecentPostList, InsideRecentPostList, + InsideRecentPostBox, InsideRecentPost }; QStringList rc; QXmlStreamReader reader(io); @@ -282,7 +283,13 @@ static inline QStringList parseLists(QIODevice *io) } } else if (reader.name() == divElement) { // "<div>" state switching switch (state) { + // Check on the contents as there are several lists. case OutsideRecentPostList: + if (reader.attributes().value(classAttribute) == QLatin1String("content_left_title") + && reader.readElementText() == QLatin1String("Recent Posts")) + state = InsideRecentPostList; + break; + case InsideRecentPostList: if (reader.attributes().value(classAttribute) == QLatin1String("content_left_box")) state = InsideRecentPostBox; break; |