Commits

zjes committed eb67d0e

Cleanup some warnings

Comments (0)

Files changed (16)

 cmake_minimum_required(VERSION 2.8.3)
 
 project(pynoto)
-set(CMAKE_BUILD_TYPE Debug)
+set(CMAKE_BUILD_TYPE Release)
 
 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
 set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/plugins)

src/Core/ColorChooser.cpp

     }
 }
 
-QSize ColorChooser::sizeHint()
+QSize ColorChooser::sizeHint() const
 {
     return QSize(60, 24);
 }

src/Core/ColorChooser.h

     void changed(const QColor& color);
 protected:
     virtual void paintEvent(QPaintEvent *);
-    virtual QSize sizeHint();
+    virtual QSize sizeHint() const;
 private:
     bool isLight();
 private:

src/EditorsManager/EditorsContainer.cpp

 
 Editors::IEditor * EditorsContainer::createEditor(const QString& fileName, EditorType type, bool sample)
 {
-    Editors::IEditorPlugin * plugin;
+    Editors::IEditorPlugin * plugin = 0;
     switch(type){
     case Text:
         plugin = Aux::plugin<Editors::IEditorPlugin*>("texteditor");
     default:
         break;
     }
-    return plugin->createEditor(fileName, this, sample);
+    if (plugin)
+        return plugin->createEditor(fileName, this, sample);
+    return 0;
 }
 
 void EditorsContainer::openFileOffset(const QString& fileName, int offset)

src/IconProvider/IconProvider.cpp

 
 namespace IconProvider {
 
-IconProvider::IconProvider():
+IconProviderImpl::IconProviderImpl():
     IIconProvider()
 {
 }
 
-bool IconProvider::initialize()
+bool IconProviderImpl::initialize()
 {
     QString themeName = QIcon::themeName();
     if (themeName == "hicolor"){
 }
 
 
-QIcon IconProvider::icon(IconRole role)
+QIcon IconProviderImpl::icon(IconRole role)
 {
     QString name;
 
     return _cache["folder+"+name];
 }
 
-QIcon IconProvider::createCompositeIcon(const QIcon proto, const QImage & srcPixmap)
+QIcon IconProviderImpl::createCompositeIcon(const QIcon proto, const QImage & srcPixmap)
 {
     QIcon res;
     QList<QSize> sizes; sizes << QSize(16, 16) << QSize(22, 22) << QSize(32, 32);
     return res;
 }
 
-void IconProvider::createIcon(QIcon & dest, const QIcon & src, QSize size, const QImage & srcPixmap, QIcon::Mode mode, QIcon::State state)
+void IconProviderImpl::createIcon(QIcon & dest, const QIcon & src, QSize size, const QImage & srcPixmap, QIcon::Mode mode, QIcon::State state)
 {
     QPixmap pix = src.pixmap(size, mode, state);
     QPainter paint(&pix);
     dest.addPixmap(pix, mode, state);
 }
 
-QIcon IconProvider::icon(const QString & iconName)
+QIcon IconProviderImpl::icon(const QString & iconName)
 {
     if (_cache.contains("icon+"+iconName))
         return _cache["icon+"+iconName];
     return _cache["icon+"+iconName];
 }
 
-QIcon IconProvider::icon(const QFileInfo & info)
+QIcon IconProviderImpl::icon(const QFileInfo & info)
 {
     QString ext = info.fileName().split(".").last();
 
     //return QApplication::style()->standardIcon(QStyle::SP_FileIcon);
 }
 
-bool IconProvider::readSettings()
+bool IconProviderImpl::readSettings()
 {
     return true;
 }
 
-QPixmap IconProvider::pixmap(const QString & imageName)
+QPixmap IconProviderImpl::pixmap(const QString & imageName)
 {
     return QPixmap(":/icons/images/"+imageName+".png");
 }

src/IconProvider/IconProvider.h

 
 namespace IconProvider {
 
-class IconProvider : public IIconProvider
+class IconProviderImpl : public IIconProvider
 {
     Q_OBJECT
     Q_PLUGIN_METADATA(IID "Pynoto.IIconProvider")
     Q_INTERFACES(IconProvider::IIconProvider)
 public:
-    IconProvider();
+    IconProviderImpl();
 
     virtual bool initialize();
     virtual bool readSettings();

src/Main/ConsoleWidget.cpp

 {
     _buttonGroup->button(0)->setText(model && model->rowCount() ? tr("Issues (%1)").arg(model->rowCount()) : tr("Issues"));
     _issues->setModel(model);
-    switchTo(0);
+    //switchTo(0);
 }
 
 void ConsoleWidget::switchTo(int mode)

src/Project/ProjectManagerWidget.cpp

     _menu->popup(mapToGlobal(pt));
 }
 
-QSize ProjectManagerWidget::minimumSizeHint()
+QSize ProjectManagerWidget::minimumSizeHint() const
 {
     return QSize(250, 200);
 }
 
 bool ProjectManagerWidget::removeDir(const QString & dirName)
 {
-    bool result;
+    bool result = false;
     QDir dir(dirName);
 
     if (dir.exists(dirName)) {

src/Project/ProjectManagerWidget.h

     void onItemExpanded(const QModelIndex&);
 
     void onMenuShow(const QPoint&);
-    virtual QSize minimumSizeHint();
+    virtual QSize minimumSizeHint() const;
 private slots:
     void openFile();
     void addNew();

src/Project/ProjectTreeModel.cpp

     return QVariant();
 }
 
-QVariant ProjectTreeModel::headerData(int /*section*/, Qt::Orientation /*orientation*/, int /*role*/)
+QVariant ProjectTreeModel::headerData(int /*section*/, Qt::Orientation /*orientation*/, int /*role*/) const
 {
     return QVariant();
 }

src/Project/ProjectTreeModel.h

     int rowCount(const QModelIndex & parent = QModelIndex()) const;
     int columnCount(const QModelIndex & parent = QModelIndex()) const;
     QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
-    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole);
+    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
 
     QList<QModelIndex> indexForPath(const QString & path);
     void setModify(const QString & path, bool m);

src/PythonCode/PythonCode.cpp

 
     _proc->start(interpret, QStringList() << "-u" << path);
     QString ip;
-    int port;
+    int port = 0;
     _proc->waitForStarted();
     _proc->waitForReadyRead();
     QStringList out = QString(_proc->readAll()).split(' ');

src/TextEditor/BaseDocumentLayout.cpp

     emit documentSizeChanged(documentSize());
 }
 
-QSizeF BaseDocumentLayout::documentSize()
+QSizeF BaseDocumentLayout::documentSize() const
 {
     QSizeF size = QPlainTextDocumentLayout::documentSize();
     QTextBlock block = document()->firstBlock();

src/TextEditor/BaseDocumentLayout.h

 public:
     BaseDocumentLayout(QTextDocument *doc);
     virtual ~BaseDocumentLayout();
-    virtual QSizeF documentSize();
+    virtual QSizeF documentSize() const;
 public:
     void emitDocumentSizeChanged();
 };

src/TextEditor/FoldInfo.cpp

+#include "FoldInfo.h"
 
 int main(int argc, char *argv[])
 {
-    #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
+    #if QT_VERSION < 0x050000
     QTextCodec::setCodecForCStrings( QTextCodec::codecForName("utf8") );
     QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
     #endif