Commit fb87efe4 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Fix some compilation warnings

- Always initialize variables
- Fix duplicate item names in a .ui file
- "enumeration value not handled in switch"
parent 5f23c8f0
......@@ -499,24 +499,21 @@ void BrowseMainPage::updateSortOrder()
{
const QAction* action = d->mSortAction->checkedAction();
GV_RETURN_IF_FAIL(action);
const Qt::SortOrder order = d->mSortDescendingAction->isChecked() ? Qt::DescendingOrder : Qt::AscendingOrder;
KDirModel::ModelColumns column;
int sortRole;
KDirModel::ModelColumns column = KDirModel::Name;
int sortRole = Qt::DisplayRole;
// Map Sorting::Enum to model columns and sorting roles
switch (sortingFromSortAction(action)) {
case Sorting::Name:
column = KDirModel::Name;
sortRole = Qt::DisplayRole;
break;
case Sorting::Size:
column = KDirModel::Size;
sortRole = Qt::DisplayRole;
break;
case Sorting::Date:
column = KDirModel::ModifiedTime;
sortRole = Qt::DisplayRole;
break;
#ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE
case Sorting::Rating:
......
......@@ -285,7 +285,7 @@
</widget>
</item>
<item row="13" column="1">
<spacer name="verticalSpacer_3">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
......
......@@ -376,7 +376,7 @@ void VideoViewAdapter::updateTimestamps()
switch (d->mMediaObject->state()) {
case Phonon::PlayingState:
case Phonon::BufferingState:
case Phonon::PausedState:
case Phonon::PausedState: {
qint64 current = d->mMediaObject->currentTime();
currentTime = QDateTime::fromSecsSinceEpoch(current/1000).toUTC().toString("h:mm:ss");
if (currentTime.startsWith("0:")) {
......@@ -392,6 +392,10 @@ void VideoViewAdapter::updateTimestamps()
break;
}
default:
break;
}
d->mCurrentTime->setText(currentTime);
d->mRemainingTime->setText(remainingTime);
}
......
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