Commit 80802310 authored by Laurent Montel's avatar Laurent Montel 😁

const'ify. Minor

parent acfd5282
......@@ -569,7 +569,7 @@ bool DBMan::clearCategories( int blog_id )
return res;
}
int DBMan::addFile( QString name, int blog_id, bool isUploaded, QString localUrl, QString remoteUrl )
int DBMan::addFile( const QString& name, int blog_id, bool isUploaded, const QString& localUrl, const QString& remoteUrl )
// int DBMan::addFile( const QString &name, int blog_id, bool isLocal, const QString &localUrl, const QString &remoteUrl )
{
QSqlQuery q;
......
......@@ -126,7 +126,7 @@ public:
bool clearCategories( int blog_id );
///File:
int addFile( QString name, int blog_id, bool isUploaded, QString localUrl, QString remoteUrl );
int addFile(const QString &name, int blog_id, bool isUploaded, const QString &localUrl, const QString &remoteUrl );
int addFile( const BilboMedia& file );
int addFile();
bool removeFile( int fileid );
......
......@@ -31,9 +31,9 @@
EntriesCountDialog::EntriesCountDialog( QWidget *parent )
: KDialog( parent )
{
QWidget *dialog = new QWidget;
ui.setupUi( dialog );
this->setMainWidget( dialog );
QWidget *widget = new QWidget;
ui.setupUi( widget );
setMainWidget( widget );
ui.spinCount->setValue(Settings::updateEntriesCount());
}
......
......@@ -206,7 +206,7 @@ void MainWindow::loadTempPosts()
{
kDebug();
QMap<BilboPost*, int> tempList = DBMan::self()->listTempPosts();
int count = tempList.count();
const int count = tempList.count();
if ( count > 0 ){
QMap<BilboPost*, int>::ConstIterator it = tempList.constBegin();
QMap<BilboPost*, int>::ConstIterator endIt = tempList.constEnd();
......@@ -521,7 +521,7 @@ void MainWindow::slotNewPostOpened( BilboPost &newPost, int blog_id )
void MainWindow::slotSavePostLocally()
{
kDebug();
if (activePost && tabPosts->count() > 0) {
if (activePost && (tabPosts->count() > 0)) {
toolbox->getFieldsValue(activePost->currentPost());
activePost->saveLocally();
toolbox->reloadLocalPosts();
......
......@@ -160,13 +160,12 @@ void Toolbox::slotLoadEntriesFromDB( int blog_id )
return;
}
lstEntriesList->clear();
QList<QVariantMap> listEntries;
listEntries = DBMan::self()->listPostsInfo( blog_id );
int count = listEntries.count();
const QList<QVariantMap> listEntries = DBMan::self()->listPostsInfo( blog_id );
const int count = listEntries.count();
for ( int i=0; i < count; ++i ) {
QListWidgetItem *lstItem = new QListWidgetItem( listEntries[i].value(QLatin1String("title")).toString() );
lstItem->setToolTip(listEntries.at(i).value(QLatin1String("c_time")).toDateTime().toString());
if (listEntries[i].value(QLatin1String("is_private")).toBool()) {
if (listEntries.at(i).value(QLatin1String("is_private")).toBool()) {
lstItem->setForeground(QBrush(Qt::blue));
lstItem->setToolTip(i18n("%1 (Draft)",lstItem->toolTip()));
}
......
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