20 #include "horizontaljournal.h"
21 #include "listviewwithpageheader.h"
22 #include "organicgrid.h"
23 #include "verticaljournal.h"
25 #include <QAbstractItemModel>
28 static QUrl oauthCleanedUrl(QUrl u)
31 q.removeQueryItem(
"oauth_nonce");
32 q.removeQueryItem(
"oauth_timestamp");
33 q.removeQueryItem(
"oauth_consumer_key");
34 q.removeQueryItem(
"oauth_signature_method");
35 q.removeQueryItem(
"oauth_version");
36 q.removeQueryItem(
"oauth_signature");
41 class AudioComparer :
public QObject
45 Q_INVOKABLE
bool compare(
const QUrl &url1,
const QUrl &url2)
47 return oauthCleanedUrl(url1) == oauthCleanedUrl(url2);
51 static QObject *audio_comparer_singleton_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
54 Q_UNUSED(scriptEngine)
56 return new AudioComparer();
59 void DashPlugin::registerTypes(const
char *uri)
61 Q_ASSERT(uri == QLatin1String(
"Dash"));
62 qmlRegisterType<QAbstractItemModel>();
63 qmlRegisterType<HorizontalJournal>(uri, 0, 1,
"HorizontalJournal");
64 qmlRegisterType<ListViewWithPageHeader>(uri, 0, 1,
"ListViewWithPageHeader");
65 qmlRegisterType<OrganicGrid>(uri, 0, 1,
"OrganicGrid");
66 qmlRegisterType<VerticalJournal>(uri, 0, 1,
"VerticalJournal");
67 qmlRegisterSingletonType<AudioComparer>(uri, 0, 1,
"AudioUrlComparer", audio_comparer_singleton_provider);