Janitor issues

* Use horizontalAdvance
* Remove unused code
* Hide some warnings from Qt code
* Remove message for _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
* Use CMP0077 NEW
* Move roff libraries to folder Thirdparty
* avoid operator()==
* Remove cmake_minimum_required and set version to 3.15
This commit is contained in:
Magne Sjaastad
2023-01-24 12:29:27 +01:00
committed by GitHub
parent c8dbf3d125
commit 583c248cf9
40 changed files with 24 additions and 112 deletions

View File

@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.12)
project(cafProjectDataModel)
# Unity Build

View File

@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.12)
project(cafPdmCore)
# Unity Build

View File

@@ -108,9 +108,6 @@ public:
{
}
bool operator==( T value ) const { return m_value == value; }
bool operator!=( T value ) const { return m_value != value; }
operator T() const { return m_value; }
T value() const { return m_value; }
@@ -346,22 +343,6 @@ private:
} // namespace caf
//==================================================================================================
/// Cant remember why we need those comparison operators...
//==================================================================================================
template <class T>
bool operator==( T value, const caf::AppEnum<T>& appEnum )
{
return ( appEnum == value );
}
template <class T>
bool operator!=( T value, const caf::AppEnum<T>& appEnum )
{
return ( appEnum != value );
}
//==================================================================================================
/// Implementation of stream operators to make PdmField<AppEnum<> > work smoothly
/// Assumes that the stream ends at the end of the enum text

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.15)
project(cafPdmCore_UnitTests)
@@ -14,10 +14,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
# VS 2017 : Disable warnings from from gtest code, using deprecated code
# related to TR1
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
message(
STATUS
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp

View File

@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.12)
project(cafPdmUiCore)
# Unity Build

View File

@@ -84,7 +84,7 @@ QSize QShortenedLabel::minimumSizeHint() const
QFontMetrics fontMetrics = QApplication::fontMetrics();
QString fullLabelText = fullText();
QString shortenedText = fullLabelText.left( minimumNumberOfCharacters );
int minimumWidth = fontMetrics.width( shortenedText );
int minimumWidth = fontMetrics.horizontalAdvance( shortenedText );
if ( !fullLabelText.isEmpty() )
{
@@ -94,12 +94,12 @@ QSize QShortenedLabel::minimumSizeHint() const
QStringList labelLines = fullLabelText.split( "\n" );
for ( QString line : labelLines )
{
int lineWidth = fontMetrics.width( line );
int lineWidth = fontMetrics.horizontalAdvance( line );
maxLineWidth = std::max( maxLineWidth, lineWidth );
QStringList words = line.split( " " );
if ( !words.empty() )
{
int wordWidth = fontMetrics.width( words.front() + "..." );
int wordWidth = fontMetrics.horizontalAdvance( words.front() + "..." );
maxFirstWordWidth = std::max( maxFirstWordWidth, wordWidth );
}
}
@@ -127,7 +127,7 @@ QSize QShortenedLabel::sizeHint() const
int maxLineWidth = 0;
for ( const QString& line : labelLines )
{
maxLineWidth = std::max( maxLineWidth, fontMetrics.width( line ) );
maxLineWidth = std::max( maxLineWidth, fontMetrics.horizontalAdvance( line ) );
}
// increase size hint with a few pixels to avoid linux gui issues
@@ -156,7 +156,7 @@ void caf::QShortenedLabel::resizeText( QSize paintSize )
int maxLineWidth = 0;
for ( const QString& line : labelLines )
{
maxLineWidth += fontMetrics.width( line );
maxLineWidth += fontMetrics.horizontalAdvance( line );
}
if ( maxLineWidth < paintSize.width() )

View File

@@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.12)
project(cafPdmXml)
# Unity Build

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.15)
project(cafPdmXml_UnitTests)
@@ -13,10 +13,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
# VS 2017 : Disable warnings from from gtest code, using deprecated code
# related to TR1
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
message(
STATUS
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.15)
project(cafProjectDataModel_UnitTests)
@@ -14,10 +14,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
# VS 2017 : Disable warnings from from gtest code, using deprecated code
# related to TR1
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
message(
STATUS
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
)
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp