Changeset View
Changeset View
Standalone View
Standalone View
dataengines/potd/potd.cpp
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 79 | { | |||
---|---|---|---|---|---|
99 | } | 99 | } | ||
100 | const QString providerName = parts[ 0 ]; | 100 | const QString providerName = parts[ 0 ]; | ||
101 | if ( !mFactories.contains( providerName ) ) { | 101 | if ( !mFactories.contains( providerName ) ) { | ||
102 | qDebug() << "invalid provider: " << parts[ 0 ]; | 102 | qDebug() << "invalid provider: " << parts[ 0 ]; | ||
103 | return false; | 103 | return false; | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | QVariantList args; | 106 | QVariantList args; | ||
107 | args << providerName; | | |||
108 | if ( parts.count() > 1 ) { | | |||
109 | const QDate date = QDate::fromString( parts[ 1 ], Qt::ISODate ); | | |||
110 | if ( !date.isValid() ) { | | |||
111 | qDebug() << "invalid date:" << parts[1]; | | |||
112 | return false; | | |||
113 | } | | |||
114 | 107 | | |||
115 | args << date; | 108 | for (int i = 0; i < parts.count(); i++) { | ||
109 | args << parts[i]; | ||||
116 | } | 110 | } | ||
117 | 111 | | |||
118 | auto factory = KPluginLoader(mFactories[ providerName ].fileName()).factory(); | 112 | auto factory = KPluginLoader(mFactories[ providerName ].fileName()).factory(); | ||
119 | PotdProvider *provider = nullptr; | 113 | PotdProvider *provider = nullptr; | ||
120 | if (factory) { | 114 | if (factory) { | ||
121 | provider = factory->create<PotdProvider>(this, args); | 115 | provider = factory->create<PotdProvider>(this, args); | ||
122 | } | 116 | } | ||
123 | if (provider) { | 117 | if (provider) { | ||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |