various: encapsulate all code in the olive namespace to avoid name collisions
Large-scale code cleanup. Also adds a license to the top of all files that were missing it.
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#include "dialog/sequence/sequence.h"
|
||||
#include "widget/menu/menu.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorer::ProjectExplorer(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
model_(this)
|
||||
@@ -425,3 +427,5 @@ void ProjectExplorer::DeleteSelected()
|
||||
|
||||
Core::instance()->undo_stack()->pushIfHasChildren(command);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "widget/projectexplorer/projectexplorernavigation.h"
|
||||
#include "widget/projecttoolbar/projecttoolbar.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief A widget for browsing through a Project structure.
|
||||
*
|
||||
@@ -163,4 +165,6 @@ private slots:
|
||||
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORER_H
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "projectexplorericonview.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerIconView::ProjectExplorerIconView(QWidget *parent) :
|
||||
ProjectExplorerListViewBase(parent)
|
||||
{
|
||||
@@ -27,3 +29,5 @@ ProjectExplorerIconView::ProjectExplorerIconView(QWidget *parent) :
|
||||
|
||||
setItemDelegate(&delegate_);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "projectexplorerlistviewbase.h"
|
||||
#include "projectexplorericonviewitemdelegate.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief The view widget used when ProjectExplorer is in Icon View
|
||||
*/
|
||||
@@ -37,4 +39,6 @@ private:
|
||||
ProjectExplorerIconViewItemDelegate delegate_;
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERICONVIEW_H
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#include "common/qtutils.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerIconViewItemDelegate::ProjectExplorerIconViewItemDelegate(QObject *parent) :
|
||||
QStyledItemDelegate (parent)
|
||||
{
|
||||
@@ -97,3 +99,4 @@ void ProjectExplorerIconViewItemDelegate::paint(QPainter *painter, const QStyleO
|
||||
}
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief The delegate that's used to draw items when ProjectExplorer is in Icon view
|
||||
*/
|
||||
@@ -34,4 +38,6 @@ public:
|
||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERICONVIEWITEMDELEGATE_H
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "projectexplorerlistview.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerListView::ProjectExplorerListView(QWidget *parent) :
|
||||
ProjectExplorerListViewBase(parent)
|
||||
{
|
||||
@@ -27,3 +29,5 @@ ProjectExplorerListView::ProjectExplorerListView(QWidget *parent) :
|
||||
|
||||
setItemDelegate(&delegate_);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "projectexplorerlistviewbase.h"
|
||||
#include "projectexplorerlistviewitemdelegate.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief The view widget used when ProjectExplorer is in List View
|
||||
*/
|
||||
@@ -37,4 +39,6 @@ private:
|
||||
ProjectExplorerListViewItemDelegate delegate_;
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERLISTVIEW_H
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerListViewBase::ProjectExplorerListViewBase(QWidget *parent) :
|
||||
QListView(parent)
|
||||
{
|
||||
@@ -48,3 +50,5 @@ void ProjectExplorerListViewBase::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
emit DoubleClickedEmptyArea();
|
||||
}
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#include <QListView>
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief A QListView derivative that contains functionality used by both List view and Icon view (which are both based
|
||||
* on QListView)
|
||||
@@ -53,4 +57,6 @@ signals:
|
||||
void DoubleClickedEmptyArea();
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERLISTVIEWBASE_H
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerListViewItemDelegate::ProjectExplorerListViewItemDelegate(QObject *parent) :
|
||||
QStyledItemDelegate(parent)
|
||||
{
|
||||
@@ -77,3 +79,5 @@ void ProjectExplorerListViewItemDelegate::paint(QPainter *painter, const QStyleO
|
||||
|
||||
painter->drawText(text_rect, static_cast<int>(Qt::AlignLeft | Qt::AlignVCenter), text);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief The delegate that's used to draw items when ProjectExplorer is in List view
|
||||
*/
|
||||
@@ -35,4 +39,6 @@ public:
|
||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERLISTVIEWITEMDELEGATE_H
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "common/define.h"
|
||||
#include "ui/icons/icons.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerNavigation::ProjectExplorerNavigation(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
@@ -93,3 +95,5 @@ void ProjectExplorerNavigation::UpdateIcons()
|
||||
size_slider_->setMaximum(kProjectIconSizeMaximum);
|
||||
size_slider_->setValue(kProjectIconSizeDefault);
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
#include <QSlider>
|
||||
#include <QWidget>
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief A navigation bar widget for ProjectExplorer's Icon and List views
|
||||
*
|
||||
@@ -108,4 +112,6 @@ private:
|
||||
QSlider* size_slider_;
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERLISTVIEWTOOLBAR_H
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
ProjectExplorerTreeView::ProjectExplorerTreeView(QWidget *parent) :
|
||||
QTreeView(parent)
|
||||
{
|
||||
@@ -51,3 +53,5 @@ void ProjectExplorerTreeView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
emit DoubleClickedEmptyArea();
|
||||
}
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#include <QTreeView>
|
||||
|
||||
#include "common/define.h"
|
||||
|
||||
OLIVE_NAMESPACE_ENTER
|
||||
|
||||
/**
|
||||
* @brief The view widget used when ProjectExplorer is in Tree View
|
||||
*
|
||||
@@ -55,4 +59,6 @@ signals:
|
||||
void DoubleClickedEmptyArea();
|
||||
};
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
#endif // PROJECTEXPLORERTREEVIEW_H
|
||||
|
||||
Reference in New Issue
Block a user