From b0e3bb662a87b7dcdef830ae9ac69a68f8a73224 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 9 Mar 2015 01:57:59 +0000 Subject: [PATCH] Add new Defines file to include app specific stuff and edit the necessary files --- app/ConfigureFormatDialog.cpp | 2 +- app/ConfigureFormatDialog.h | 2 +- app/DialogSubWindowSelector.h | 2 +- app/FramePropertiesSidebar.h | 2 +- app/GridManager.h | 12 ++++---- app/HistogramWidget.h | 2 +- app/ModuleHandleDock.h | 2 +- app/ModulesHandle.h | 2 +- app/PlaYUVerAppDefs.h | 47 +++++++++++++++++++++++++++++++ app/PlaYUVerAppModuleIf.h | 2 +- app/PlaYUVerMdiSubWindow.h | 2 +- app/PlaYUVerSubWindowHandle.h | 2 +- app/PlotSubWindow.h | 2 +- app/QualityHandle.h | 2 +- app/QualityMeasurementSidebar.cpp | 1 - app/QualityMeasurementSidebar.h | 1 + app/Settings.h | 2 +- app/SubWindowHandle.h | 2 +- app/VideoHandle.cpp | 1 - app/VideoHandle.h | 1 + app/VideoSubWindow.h | 2 +- app/ViewArea.h | 2 +- app/WidgetFrameNumber.h | 2 +- app/main.cpp | 2 +- app/plaYUVerApp.cpp | 2 +- app/plaYUVerApp.h | 2 +- 26 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 app/PlaYUVerAppDefs.h diff --git a/app/ConfigureFormatDialog.cpp b/app/ConfigureFormatDialog.cpp index dc47ec6..e5dc4fa 100644 --- a/app/ConfigureFormatDialog.cpp +++ b/app/ConfigureFormatDialog.cpp @@ -54,7 +54,7 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) : standardResolutionSizes.append( QSize( uiWidth, uiHeight) ); } - setObjectName( QStringLiteral( "ConfigureFormat" ) ); + setObjectName( "ConfigureFormat" ); resize( 400, 370 ); setWindowTitle( "Configure Resolution" ); diff --git a/app/ConfigureFormatDialog.h b/app/ConfigureFormatDialog.h index a6084cb..cb10ab4 100644 --- a/app/ConfigureFormatDialog.h +++ b/app/ConfigureFormatDialog.h @@ -26,7 +26,7 @@ #define __CONFIGUREFORMATDIALOG_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/DialogSubWindowSelector.h b/app/DialogSubWindowSelector.h index d429714..3779826 100644 --- a/app/DialogSubWindowSelector.h +++ b/app/DialogSubWindowSelector.h @@ -26,7 +26,7 @@ #define __DIALOGSUBWINDOWSELECTOR_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/FramePropertiesSidebar.h b/app/FramePropertiesSidebar.h index 3baf683..71a9b0f 100644 --- a/app/FramePropertiesSidebar.h +++ b/app/FramePropertiesSidebar.h @@ -26,7 +26,7 @@ #define __FRAMEPROPERTIESSIDEBAR_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/GridManager.h b/app/GridManager.h index d9d0fdd..5eebc14 100644 --- a/app/GridManager.h +++ b/app/GridManager.h @@ -27,7 +27,7 @@ #define __GRIDMANAGER_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #include #include @@ -56,23 +56,23 @@ public: void drawGrid( QPixmap &image, const QRect& area, QPainter *painter ); /** - * @returns a QRect defined by the grid that contains the point (x, y). + * @returns a QRect defined by the grid that contains the point (x, y). */ QRect rectContains( int x, int y ) const; /** * This is an overloaded member function, provided for convenience. - * @returns a QRect defined by the grid that contains the QPoint pos. + * @returns a QRect defined by the grid that contains the QPoint pos. */ QRect rectContains( const QPoint &pos ) const; /** - * @returns @c true if the point (x, y) is over a grid crossing, otherwise + * @returns @c true if the point (x, y) is over a grid crossing, otherwise * returns @c false */ bool contains( int x, int y ); /** - * @returns @c true if the point (x, y) is near a grid crossing, otherwise + * @returns @c true if the point (x, y) is near a grid crossing, otherwise * returns @c false. * @see @p nearPos() */ @@ -80,7 +80,7 @@ public: /** * This is an overloaded member function, provided for convenience. - * @returns @c true if the given point is near a grid crossing, otherwise + * @returns @c true if the given point is near a grid crossing, otherwise * returns @c false. * @see @p nearPos() */ diff --git a/app/HistogramWidget.h b/app/HistogramWidget.h index a0a8019..393f63f 100644 --- a/app/HistogramWidget.h +++ b/app/HistogramWidget.h @@ -27,7 +27,7 @@ #define __HISTOGRAMWIDGET_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #include #include "lib/PlaYUVerFrame.h" diff --git a/app/ModuleHandleDock.h b/app/ModuleHandleDock.h index e1f9963..1166439 100644 --- a/app/ModuleHandleDock.h +++ b/app/ModuleHandleDock.h @@ -26,7 +26,7 @@ #define __MODULEHANDLEDOCK_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/ModulesHandle.h b/app/ModulesHandle.h index 0542742..4329111 100644 --- a/app/ModulesHandle.h +++ b/app/ModulesHandle.h @@ -36,7 +36,7 @@ #include #endif #include "PlaYUVerAppModuleIf.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include "lib/PlaYUVerFrame.h" namespace plaYUVer diff --git a/app/PlaYUVerAppDefs.h b/app/PlaYUVerAppDefs.h new file mode 100644 index 0000000..418a6e5 --- /dev/null +++ b/app/PlaYUVerAppDefs.h @@ -0,0 +1,47 @@ +/* This file is a part of plaYUVer project + * Copyright (C) 2014-2015 by Luis Lucas (luisfrlucas@gmail.com) + * Joao Carreira (jfmcarreira@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file PlaYUVerAppDefs.h + * \brief Define types for PlaYUVerApp + */ + +#ifndef __PLAYUVERAPPDEFS_H__ +#define __PLAYUVERAPPDEFS_H__ + +#include "lib/PlaYUVerDefs.h" + +namespace plaYUVer +{ + +// ==================================================================================================================== +// Qt compatibility redefinition +// ==================================================================================================================== +#ifndef QStringLiteral +// no lambdas, not GCC, or GCC in C++98 mode with 4-byte wchar_t +// fallback, return a temporary QString +// source code is assumed to be encoded in UTF-8 + +# define QStringLiteral(str) QString::fromUtf8("" str "", sizeof(str) - 1) +#endif + + +} // NAMESPACE + +#endif // __PLAYUVERAPPDEFS_H__ diff --git a/app/PlaYUVerAppModuleIf.h b/app/PlaYUVerAppModuleIf.h index cc73748..5dda03d 100644 --- a/app/PlaYUVerAppModuleIf.h +++ b/app/PlaYUVerAppModuleIf.h @@ -26,7 +26,7 @@ #define __PLAYUVERAPPMODULESIF_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #include #include "lib/PlaYUVerFrame.h" diff --git a/app/PlaYUVerMdiSubWindow.h b/app/PlaYUVerMdiSubWindow.h index 3b47bbe..5b78920 100644 --- a/app/PlaYUVerMdiSubWindow.h +++ b/app/PlaYUVerMdiSubWindow.h @@ -26,7 +26,7 @@ #define __PLAYUVERMDISUBWINDOW_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/PlaYUVerSubWindowHandle.h b/app/PlaYUVerSubWindowHandle.h index c1fad64..7375857 100644 --- a/app/PlaYUVerSubWindowHandle.h +++ b/app/PlaYUVerSubWindowHandle.h @@ -26,7 +26,7 @@ #define __PLAYUVERSUBWINDOWHANDLE_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/PlotSubWindow.h b/app/PlotSubWindow.h index 7a30f78..a634d1e 100644 --- a/app/PlotSubWindow.h +++ b/app/PlotSubWindow.h @@ -26,7 +26,7 @@ #define __PLOTWINDOWHANDLE_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/QualityHandle.h b/app/QualityHandle.h index b48ab1d..1659dda 100644 --- a/app/QualityHandle.h +++ b/app/QualityHandle.h @@ -26,7 +26,7 @@ #define __QUALITYMEASUREMENT_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #if( QT_VERSION_PLAYUVER == 5 ) #include diff --git a/app/QualityMeasurementSidebar.cpp b/app/QualityMeasurementSidebar.cpp index 312d92d..b55e4bf 100644 --- a/app/QualityMeasurementSidebar.cpp +++ b/app/QualityMeasurementSidebar.cpp @@ -22,7 +22,6 @@ * \brief Definition of the quality measurement sidebar */ -#include "lib/PlaYUVerDefs.h" #include #include "PlaYUVerSubWindowHandle.h" #include "QualityMeasurementSidebar.h" diff --git a/app/QualityMeasurementSidebar.h b/app/QualityMeasurementSidebar.h index 917ca2e..d1c2531 100644 --- a/app/QualityMeasurementSidebar.h +++ b/app/QualityMeasurementSidebar.h @@ -26,6 +26,7 @@ #define __QUALITYMEASUREMENTSIDEBAR_H__ #include "config.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/Settings.h b/app/Settings.h index f666474..65cb5a4 100644 --- a/app/Settings.h +++ b/app/Settings.h @@ -26,7 +26,7 @@ #define __SETTINGS_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #include "GridManager.h" #include "VideoSubWindow.h" diff --git a/app/SubWindowHandle.h b/app/SubWindowHandle.h index e0f9d6d..2208a37 100644 --- a/app/SubWindowHandle.h +++ b/app/SubWindowHandle.h @@ -26,7 +26,7 @@ #define __SUBWINDOWHANDLE_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index f69e85f..e9e7c33 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -22,7 +22,6 @@ * \brief Class to handle video playback */ -#include "lib/PlaYUVerDefs.h" #include #include "PlaYUVerSubWindowHandle.h" #include "VideoHandle.h" diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 3383168..1dc13e0 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -26,6 +26,7 @@ #define __VIDEOHANDLE_H__ #include "config.h" +#include "PlaYUVerAppDefs.h" #include #if( QT_VERSION_PLAYUVER == 5 ) #include diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 6000295..07bd482 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -26,7 +26,7 @@ #define __VIDEOSUBWINDOW_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 ) diff --git a/app/ViewArea.h b/app/ViewArea.h index 9eec6ac..4a1d4bd 100644 --- a/app/ViewArea.h +++ b/app/ViewArea.h @@ -27,7 +27,7 @@ #define __VIEWAREA_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #include #include diff --git a/app/WidgetFrameNumber.h b/app/WidgetFrameNumber.h index 7aeed71..34fd3c7 100644 --- a/app/WidgetFrameNumber.h +++ b/app/WidgetFrameNumber.h @@ -27,7 +27,7 @@ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #if( QT_VERSION_PLAYUVER == 5 ) #include diff --git a/app/main.cpp b/app/main.cpp index 07ecb34..3597369 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -23,7 +23,7 @@ */ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #include #include "plaYUVerApp.h" #include "SubWindowHandle.h" diff --git a/app/plaYUVerApp.cpp b/app/plaYUVerApp.cpp index 96d1823..ff62dcb 100644 --- a/app/plaYUVerApp.cpp +++ b/app/plaYUVerApp.cpp @@ -851,7 +851,7 @@ Void plaYUVerApp::checkRecentFileActions() Int i = 0; while( i < m_aRecentFileStreamInfo.size() ) { - if( !QFileInfo::exists( m_aRecentFileStreamInfo.at( i ).m_cFilename ) ) + if( !QFileInfo( m_aRecentFileStreamInfo.at( i ).m_cFilename ).exists() ) { m_aRecentFileStreamInfo.remove( i ); continue; diff --git a/app/plaYUVerApp.h b/app/plaYUVerApp.h index 45372c3..d4f7ea9 100644 --- a/app/plaYUVerApp.h +++ b/app/plaYUVerApp.h @@ -26,7 +26,7 @@ #define __PLAYUVERAPP_H__ #include "config.h" -#include "lib/PlaYUVerDefs.h" +#include "PlaYUVerAppDefs.h" #if( QT_VERSION_PLAYUVER == 5 ) #include #elif( QT_VERSION_PLAYUVER == 4 )