Commit d07f3705 authored by camilo higuita's avatar camilo higuita

now that the crashing issue is gone.. return model

parent a9a12c79
......@@ -49,50 +49,47 @@ int main(int argc, char *argv[])
QCommandLineParser parser;
parser.addOptions({
// A boolean option with a single name (-p)
{"sync",
QCoreApplication::translate("main", "Show progress during copy")},
// A boolean option with multiple names (-f, --force)
{{"f", "force"},
QCoreApplication::translate("main", "Overwrite existing files.")},
// An option with a value
{{"t", "target-directory"},
QCoreApplication::translate("main", "Copy all source files into <directory>."),
QCoreApplication::translate("main", "directory")},
});
parser.process(app);
if(parser.isSet("sync"))
{
qDebug()<< "TESTING P";
return 0;
}
{
// std::unique_ptr<ContactImage> contactImageProvider( new ContactImage);
QQmlApplicationEngine engine;
// engine->addImageProvider(QLatin1String("colors"), new ColorImageProvider);
// QQuickStyle::setStyle("Material");
// A boolean option with a single name (-p)
{"sync",
QCoreApplication::translate("main", "Show progress during copy")},
// A boolean option with multiple names (-f, --force)
{{"f", "force"},
QCoreApplication::translate("main", "Overwrite existing files.")},
// An option with a value
{{"t", "target-directory"},
QCoreApplication::translate("main", "Copy all source files into <directory>."),
QCoreApplication::translate("main", "directory")},
});
parser.process(app);
if(parser.isSet("sync"))
{
qDebug()<< "TESTING P";
return 0;
}
{
QQmlApplicationEngine engine;
// QQuickStyle::setStyle("Material");
#ifdef STATIC_KIRIGAMI
KirigamiPlugin::getInstance().registerTypes();
KirigamiPlugin::getInstance().registerTypes();
#endif
#ifdef STATIC_MAUIKIT
MauiKit::getInstance().registerTypes();
MauiKit::getInstance().registerTypes();
#endif
engine.addImageProvider("contact", new ContactImage(QQuickImageProvider::ImageType::Image));
qmlRegisterUncreatableType<BaseList>("UnionModels", 1, 0, "BaseList", QStringLiteral("BaseList should not be created in QML"));
qmlRegisterType<BaseModel>("UnionModels", 1, 0, "BaseModel");
qmlRegisterType<ContactsModel>("UnionModels", 1, 0, "ContactsList");
qmlRegisterType<CallLogs>("UnionModels", 1, 0, "CallLogs");
engine.addImageProvider("contact", new ContactImage(QQuickImageProvider::ImageType::Image));
qmlRegisterUncreatableType<BaseList>("UnionModels", 1, 0, "BaseList", QStringLiteral("BaseList should not be created in QML"));
qmlRegisterType<BaseModel>("UnionModels", 1, 0, "BaseModel");
qmlRegisterType<ContactsModel>("UnionModels", 1, 0, "ContactsList");
qmlRegisterType<CallLogs>("UnionModels", 1, 0, "CallLogs");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
return app.exec();
}
}
......@@ -13,20 +13,20 @@
ContactsModel::ContactsModel(QObject *parent) : BaseList(parent), syncer(new Synchroniser(this))
{
// connect(syncer, &Synchroniser::contactsReady, [this](FMH::MODEL_LIST contacts)
// {
// qDebug() << "CONATCTS READY AT MODEL 1" << contacts;
// emit this->preListChanged();
// this->list = contacts;
// this->listbk = this->list;
// qDebug() << "CONATCTS READY AT MODEL" << this->list;
// this->filter();
// this->sortList();
// emit this->postListChanged();
// });
// this->getList(true);
connect(syncer, &Synchroniser::contactsReady, [this](FMH::MODEL_LIST contacts)
{
qDebug() << "CONATCTS READY AT MODEL 1" << contacts;
emit this->preListChanged();
this->list = contacts;
this->listbk = this->list;
qDebug() << "CONATCTS READY AT MODEL" << this->list;
this->filter();
this->sortList();
emit this->postListChanged();
});
this->getList(true);
}
FMH::MODEL_LIST ContactsModel::items() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment