Commit 265965da authored by Ronan's avatar Ronan
Browse files

fix(app): coding style & log app startup

parent 59c0154f
......@@ -61,6 +61,8 @@ App::App (int &argc, char **argv) : QApplication(argc, argv) {
// -------------------------------------------------------------------
void App::initContentApp () {
qInfo() << "Initializing core manager...";
// Init core.
CoreManager::init();
......@@ -69,6 +71,7 @@ void App::initContentApp () {
addContextProperties();
// Load main view.
qInfo() << "Loading main view...";
m_engine.load(QUrl(QML_VIEW_MAIN_WINDOW));
if (m_engine.rootObjects().isEmpty())
qFatal("Unable to open main window.");
......@@ -81,6 +84,8 @@ void App::initContentApp () {
}
void App::registerTypes () {
qInfo() << "Registering types...";
// Register meta types.
qmlRegisterUncreatableType<Presence>(
"Linphone", 1, 0, "Presence", "Presence is uncreatable"
......@@ -143,14 +148,16 @@ void App::registerTypes () {
}
void App::addContextProperties () {
qInfo() << "Adding context properties...";
QQmlContext *context = m_engine.rootContext();
QQmlComponent component(&m_engine, QUrl(QML_VIEW_CALL_WINDOW));
// Windows.
if (component.isError())
QQmlComponent component(&m_engine, QUrl(QML_VIEW_CALL_WINDOW));
if (component.isError()) {
qWarning() << component.errors();
else
context->setContextProperty("CallsWindow", component.create());
abort();
}
context->setContextProperty("CallsWindow", component.create());
m_notifier = new Notifier();
context->setContextProperty("Notifier", m_notifier);
......
......@@ -20,7 +20,7 @@ QHash<int, QByteArray> ChatModel::roleNames () const {
return roles;
}
int ChatModel::rowCount (const QModelIndex&) const {
int ChatModel::rowCount (const QModelIndex &) const {
return m_entries.count();
}
......@@ -40,7 +40,7 @@ QVariant ChatModel::data (const QModelIndex &index, int role) const {
return QVariant();
}
bool ChatModel::removeRow (int row, const QModelIndex&) {
bool ChatModel::removeRow (int row, const QModelIndex &) {
return removeRows(row, 1);
}
......
......@@ -49,7 +49,7 @@ private:
// and reused by `lessThan`.
mutable QHash<const ContactModel *, unsigned int> m_weights;
bool m_use_connected_filter;
bool m_use_connected_filter = false;
static const QRegExp m_search_separators;
......
......@@ -132,12 +132,12 @@ RowLayout {
}
padding: ListFormStyle.value.text.padding
visible: values.model.count === 0 // TODO: placeholder click machin
visible: values.model.count === 0
verticalAlignment: Text.AlignVCenter
MouseArea {
anchors.fill: parent
onClicked: _addValue('')
onClicked: !listForm.readOnly && _addValue('')
}
}
......
......@@ -5,7 +5,6 @@ import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import Linphone.Styles 1.0
import Utils 1.0
// ===================================================================
......
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