Add jdenticon support
This commit is contained in:
parent
e88ab89c18
commit
d2e193ff78
11 changed files with 176 additions and 31 deletions
|
|
@ -16,6 +16,7 @@
|
|||
#include "Cache_p.h"
|
||||
#include "ChatPage.h"
|
||||
#include "Config.h"
|
||||
#include "JdenticonProvider.h"
|
||||
#include "Logging.h"
|
||||
#include "LoginPage.h"
|
||||
#include "MainWindow.h"
|
||||
|
|
@ -152,10 +153,6 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
showChatPage();
|
||||
}
|
||||
});
|
||||
|
||||
if (loadJdenticonPlugin()) {
|
||||
nhlog::ui()->info("loaded jdenticon.");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -428,29 +425,6 @@ MainWindow::showDialog(QWidget *dialog)
|
|||
dialog->show();
|
||||
}
|
||||
|
||||
bool
|
||||
MainWindow::loadJdenticonPlugin()
|
||||
{
|
||||
QDir pluginsDir(qApp->applicationDirPath());
|
||||
|
||||
bool plugins = pluginsDir.cd("plugins");
|
||||
if (plugins) {
|
||||
foreach (QString fileName, pluginsDir.entryList(QDir::Files)) {
|
||||
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
|
||||
QObject *plugin = pluginLoader.instance();
|
||||
if (plugin) {
|
||||
jdenticonInteface_ = qobject_cast<JdenticonInterface *>(plugin);
|
||||
if (jdenticonInteface_) {
|
||||
nhlog::ui()->info("Found jdenticon plugin.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nhlog::ui()->info("jdenticon plugin not found.");
|
||||
return false;
|
||||
}
|
||||
void
|
||||
MainWindow::showWelcomePage()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue