Skip to content

Commit

Permalink
fix windows warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 7, 2017
1 parent 27dbb48 commit a102490
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 40 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Expand Up @@ -519,13 +519,6 @@ IF (WITH_CORE)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)

IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
IF (NOT USING_NMAKE AND NOT USING_NINJA)
MESSAGE (STATUS "Generating browse files")
ADD_DEFINITIONS( /FR )
ENDIF (NOT USING_NMAKE AND NOT USING_NINJA)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)

IF (INSTALL_DEPS)
INSTALL(DIRECTORY ${INSTALL_DEPS} DESTINATION .)
ENDIF (INSTALL_DEPS)
Expand Down
1 change: 0 additions & 1 deletion python/server/qgsserver.sip
Expand Up @@ -70,7 +70,6 @@ Returns a pointer to the server interface
:rtype: QgsServer
%End
};

/************************************************************************
* This file has been generated automatically from *
* *
Expand Down
1 change: 0 additions & 1 deletion src/app/layout/qgslayoutmapwidget.cpp
Expand Up @@ -1412,7 +1412,6 @@ QgsLayoutItemMapOverview *QgsLayoutMapWidget::currentOverview()
}

return mMapItem->overviews()->overview( item->data( Qt::UserRole ).toString() );
return nullptr;
}

void QgsLayoutMapWidget::mOverviewListWidget_currentItemChanged( QListWidgetItem *current, QListWidgetItem *previous )
Expand Down
5 changes: 1 addition & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -12112,10 +12112,7 @@ void QgisApp::keyPressEvent( QKeyEvent *e )
#if defined(_MSC_VER) && defined(QGISDEBUG)
else if ( e->key() == Qt::Key_Backslash && e->modifiers() & Qt::ControlModifier )
{
int *i;
*i = 10;
// *((int*)0 + 1) = 5;
// QgsCrashHandler::handle( 0 );
abort();

This comment has been minimized.

Copy link
@NathanW2

NathanW2 Nov 7, 2017

Member

@jef-n what does about() do here in this case. I put a real crash here in order to test the crash handler because I need it to really segfault.

}
#endif
else
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsmaptoollabel.cpp
Expand Up @@ -146,7 +146,7 @@ QString QgsMapToolLabel::currentLabelText( int trunc )
if ( trunc > 0 && labelText.length() > trunc )
{
labelText.truncate( trunc );
labelText += QStringLiteral( "\u2026" );
labelText += QChar( 0x2026 );
}
return labelText;
}
Expand All @@ -169,7 +169,7 @@ QString QgsMapToolLabel::currentLabelText( int trunc )
if ( trunc > 0 && labelText.length() > trunc )
{
labelText.truncate( trunc );
labelText += QStringLiteral( "\u2026" );
labelText += QChar( 0x2026 );
}
return labelText;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolmovelabel.cpp
Expand Up @@ -54,7 +54,7 @@ void QgsMapToolMoveLabel::canvasPressEvent( QgsMapMouseEvent *e )
return;
}

int xCol, yCol;
int xCol = -1, yCol = -1;

if ( !mCurrentLabel.pos.isDiagram && !labelMoveable( vlayer, mCurrentLabel.settings, xCol, yCol ) )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpression.cpp
Expand Up @@ -561,7 +561,7 @@ QString QgsExpression::helpText( QString name )

if ( v.mVariableLenArguments )
{
helpContents += QStringLiteral( "\u2026" );
helpContents += QChar( 0x2026 );
}

helpContents += ')';
Expand Down
4 changes: 2 additions & 2 deletions src/crashhandler/main.cpp
Expand Up @@ -32,7 +32,7 @@ int main( int argc, char *argv[] )
if ( argc < 2 )
{
std::cout << "QGIS Crash Handler Usage: \n"
<< "qgscrashhandler {infofile}" << std::endl;
<< "qgiscrashhandler {infofile}" << std::endl;
return -1;
}

Expand Down Expand Up @@ -73,7 +73,7 @@ int main( int argc, char *argv[] )
sscanf_s( exceptionPointersString.toLocal8Bit().constData(), "%p", &exception );

std::cout << "Process ID: " << processIdString.toLocal8Bit().constData() << std::endl;
std::cout << "Trhead ID:" << threadIdString.toLocal8Bit().constData() << std::endl;
std::cout << "Thread ID:" << threadIdString.toLocal8Bit().constData() << std::endl;
std::cout << "Exception Pointer: " << exceptionPointersString.toLocal8Bit().constData() << std::endl;
std::cout << "Symbol Path :" << symbolPaths.toUtf8().data() << std::endl;

Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsattributeformeditorwidget.cpp
Expand Up @@ -143,17 +143,17 @@ void QgsAttributeFormEditorWidget::setConstraintStatus( const QString &constrain
switch ( result )
{
case QgsEditorWidgetWrapper::ConstraintResultFailHard:
mConstraintResultLabel->setText( QStringLiteral( "<font color=\"#FF9800\">\u2718</font>" ) );
mConstraintResultLabel->setText( QStringLiteral( "<font color=\"#FF9800\">%1</font>" ).arg( QChar( 0x2718 ) ) );
mConstraintResultLabel->setToolTip( description.isEmpty() ? QStringLiteral( "<b>%1</b>: %2" ).arg( constraint, err ) : description );
break;

case QgsEditorWidgetWrapper::ConstraintResultFailSoft:
mConstraintResultLabel->setText( QStringLiteral( "<font color=\"#FFC107\">\u2718</font>" ) );
mConstraintResultLabel->setText( QStringLiteral( "<font color=\"#FFC107\">%1</font>" ).arg( QChar( 0x2718 ) ) );
mConstraintResultLabel->setToolTip( description.isEmpty() ? QStringLiteral( "<b>%1</b>: %2" ).arg( constraint, err ) : description );
break;

case QgsEditorWidgetWrapper::ConstraintResultPass:
mConstraintResultLabel->setText( QStringLiteral( "<font color=\"#259b24\">\u2714</font>" ) );
mConstraintResultLabel->setText( QStringLiteral( "<font color=\"#259B24\">%1</font>" ).arg( QChar( 0x2714 ) ) );
mConstraintResultLabel->setToolTip( QString() );
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfilewidget.cpp
Expand Up @@ -56,7 +56,7 @@ QgsFileWidget::QgsFileWidget( QWidget *parent )
mLayout->addWidget( mLineEdit );

mFileWidgetButton = new QToolButton( this );
mFileWidgetButton->setText( QStringLiteral( "\u2026" ) );
mFileWidgetButton->setText( QChar( 0x2026 ) );
connect( mFileWidgetButton, &QAbstractButton::clicked, this, &QgsFileWidget::openFileDialog );
mLayout->addWidget( mFileWidgetButton );

Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgspropertyoverridebutton.cpp
Expand Up @@ -440,7 +440,7 @@ void QgsPropertyOverrideButton::aboutToShowMenu()
if ( expString.length() > 35 )
{
expString.truncate( 35 );
expString.append( "\u2026" );
expString.append( QChar( 0x2026 ) );
}

expString.prepend( tr( "Current: " ) );
Expand Down Expand Up @@ -711,7 +711,7 @@ void QgsPropertyOverrideButton::updateGui()
if ( deftip.length() > 75 )
{
deftip.truncate( 75 );
deftip.append( "\u2026" );
deftip.append( QChar( 0x2026 ) );
}

mFullDescription += tr( "<b>Current definition %1:</b><br>%2" ).arg( deftype, deftip );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgssqlcomposerdialog.cpp
Expand Up @@ -357,7 +357,7 @@ void QgsSQLComposerDialog::addTableNames( const QList<PairNameTitle> &listNameTi
if ( pair.second.size() < 40 )
entryText += " (" + pair.second + ")";
else
entryText += " (" + pair.second.mid( 0, 20 ) + "\u2026" + pair.second.mid( pair.second.size() - 20 ) + ")";
entryText += " (" + pair.second.mid( 0, 20 ) + QChar( 0x2026 ) + pair.second.mid( pair.second.size() - 20 ) + ")";
}
listCombo << entryText;
mapTableEntryTextToName[entryText] = pair.first;
Expand Down
3 changes: 2 additions & 1 deletion src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
Expand Up @@ -436,7 +436,8 @@ void QgsDelimitedTextSourceSelect::updateFieldLists()
for ( int i = 0; i < tblSample->columnCount(); i++ )
{
QString value = i < nv ? values[i] : QLatin1String( "" );
if ( value.length() > MAX_SAMPLE_LENGTH ) value = value.mid( 0, MAX_SAMPLE_LENGTH ) + "\u2026";
if ( value.length() > MAX_SAMPLE_LENGTH )
value = value.mid( 0, MAX_SAMPLE_LENGTH ) + QChar( 0x2026 );
QTableWidgetItem *item = new QTableWidgetItem( value );
tblSample->setItem( counter - 1, i, item );
if ( ! value.isEmpty() )
Expand Down
10 changes: 6 additions & 4 deletions src/server/qgsserver.cpp
Expand Up @@ -63,7 +63,7 @@ QgsServerInterfaceImpl *QgsServer::sServerInterface = nullptr;
bool QgsServer::sInitialized = false;
QgsServerSettings QgsServer::sSettings;

QgsServiceRegistry QgsServer::sServiceRegistry;
QgsServiceRegistry *QgsServer::sServiceRegistry = nullptr;

QgsServer::QgsServer()
{
Expand Down Expand Up @@ -271,12 +271,14 @@ bool QgsServer::init()
QgsFontUtils::loadStandardTestFonts( QStringList() << QStringLiteral( "Roman" ) << QStringLiteral( "Bold" ) );
#endif

sServerInterface = new QgsServerInterfaceImpl( sCapabilitiesCache, &sServiceRegistry, &sSettings );
sServiceRegistry = new QgsServiceRegistry();

sServerInterface = new QgsServerInterfaceImpl( sCapabilitiesCache, sServiceRegistry, &sSettings );

// Load service module
QString modulePath = QgsApplication::libexecPath() + "server";
qDebug() << "Initializing server modules from " << modulePath << endl;
sServiceRegistry.init( modulePath, sServerInterface );
sServiceRegistry->init( modulePath, sServerInterface );

sInitialized = true;
QgsMessageLog::logMessage( QStringLiteral( "Server initialized" ), QStringLiteral( "Server" ), QgsMessageLog::INFO );
Expand Down Expand Up @@ -386,7 +388,7 @@ void QgsServer::handleRequest( QgsServerRequest &request, QgsServerResponse &res
}

// Lookup for service
QgsService *service = sServiceRegistry.getService( serviceString, versionString );
QgsService *service = sServiceRegistry->getService( serviceString, versionString );
if ( service )
{
service->executeRequest( request, responseDecorator, project );
Expand Down
3 changes: 1 addition & 2 deletions src/server/qgsserver.h
Expand Up @@ -134,12 +134,11 @@ class SERVER_EXPORT QgsServer
static bool sInitialized;

//! service registry
static QgsServiceRegistry sServiceRegistry;
static QgsServiceRegistry *sServiceRegistry;

static QgsServerSettings sSettings;

//! cache
QgsConfigCache *mConfigCache = nullptr;
};
#endif // QGSSERVER_H

14 changes: 7 additions & 7 deletions tests/src/gui/testqgsattributeform.cpp
Expand Up @@ -92,9 +92,9 @@ void TestQgsAttributeForm::testFieldConstraint()
form.setFeature( ft );

// testing stuff
QString validLabel = QStringLiteral( "<font color=\"#259b24\">\u2714</font>" );
QString invalidLabel = QStringLiteral( "<font color=\"#FF9800\">\u2718</font>" );
QString warningLabel = QStringLiteral( "<font color=\"#FFC107\">\u2718</font>" );
QString validLabel = QStringLiteral( "<font color=\"#259B24\">%1</font>" ).arg( QChar( 0x2714 ) );
QString invalidLabel = QStringLiteral( "<font color=\"#FF9800\">%1</font>" ).arg( QChar( 0x2718 ) );
QString warningLabel = QStringLiteral( "<font color=\"#FFC107\">%1</font>" ).arg( QChar( 0x2718 ) );

// set constraint
layer->setConstraintExpression( 0, QString() );
Expand Down Expand Up @@ -177,8 +177,8 @@ void TestQgsAttributeForm::testFieldMultiConstraints()

// testing stuff
QSignalSpy spy( &form, SIGNAL( attributeChanged( QString, QVariant ) ) );
QString val = QStringLiteral( "<font color=\"#259b24\">\u2714</font>" );
QString inv = QStringLiteral( "<font color=\"#FF9800\">\u2718</font>" );
QString val = QStringLiteral( "<font color=\"#259B24\">%1</font>" ).arg( 0x2714 );
QString inv = QStringLiteral( "<font color=\"#FF9800\">%1</font>" ).arg( 0x2718 );

// get wrappers for each widget
QgsEditorWidgetWrapper *ww0, *ww1, *ww2, *ww3;
Expand Down Expand Up @@ -440,8 +440,8 @@ void TestQgsAttributeForm::testDynamicForm()

void TestQgsAttributeForm::testConstraintsOnJoinedFields()
{
QString validLabel = QStringLiteral( "<font color=\"#259b24\">\u2714</font>" );
QString warningLabel = QStringLiteral( "<font color=\"#FFC107\">\u2718</font>" );
QString validLabel = QStringLiteral( "<font color=\"#259B24\">%1</font>" ).arg( QChar( 0x2714 ) );
QString warningLabel = QStringLiteral( "<font color=\"#FFC107\">%1</font>" ).arg( QChar( 0x2718 ) );

// make temporary layers
QString defA = QStringLiteral( "Point?field=id_a:integer" );
Expand Down

0 comments on commit a102490

Please sign in to comment.