some refactoring

* fix undefinded behaviour
* drop dbus timout, use generic timeout insead
* drop load source to own cmake key
* update contributing.md
This commit is contained in:
2016-06-30 01:59:06 +03:00
parent 5cd5272f10
commit 8e8ac2f3c7
15 changed files with 75 additions and 65 deletions

View File

@ -66,7 +66,7 @@ void AbstractExtItemAggregator::copyItem()
.arg(QStandardPaths::writableLocation(
QStandardPaths::GenericDataLocation))
.arg(m_type);
if ((source == nullptr) || (fileName.isEmpty())) {
if ((!source) || (fileName.isEmpty())) {
qCWarning(LOG_LIB) << "Nothing to copy";
return;
}
@ -83,7 +83,7 @@ void AbstractExtItemAggregator::copyItem()
void AbstractExtItemAggregator::deleteItem()
{
AbstractExtItem *source = itemFromWidget();
if (source == nullptr) {
if (!source) {
qCWarning(LOG_LIB) << "Nothing to delete";
return;
};
@ -98,7 +98,7 @@ void AbstractExtItemAggregator::deleteItem()
void AbstractExtItemAggregator::editItem()
{
AbstractExtItem *source = itemFromWidget();
if (source == nullptr) {
if (!source) {
qCWarning(LOG_LIB) << "Nothing to edit";
return;
};
@ -128,7 +128,7 @@ QString AbstractExtItemAggregator::getName()
AbstractExtItem *AbstractExtItemAggregator::itemFromWidget()
{
QListWidgetItem *widgetItem = ui->listWidget->currentItem();
if (widgetItem == nullptr)
if (!widgetItem)
return nullptr;
AbstractExtItem *found = nullptr;
@ -139,7 +139,7 @@ AbstractExtItem *AbstractExtItemAggregator::itemFromWidget()
found = item;
break;
}
if (found == nullptr)
if (!found)
qCWarning(LOG_LIB) << "Could not find item by name"
<< widgetItem->text();