Skip to content
Permalink
Browse files

fix windows warnings

  • Loading branch information
jef-n committed Nov 7, 2017
1 parent 27dbb48 commit a1024905bfd2cec9e1ec30902ca51936d6d811ec
@@ -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)
@@ -70,7 +70,6 @@ Returns a pointer to the server interface
:rtype: QgsServer
%End
};

/************************************************************************
* This file has been generated automatically from *
* *
@@ -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 )
@@ -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
@@ -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;
}
@@ -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;
}
@@ -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 ) )
{
@@ -561,7 +561,7 @@ QString QgsExpression::helpText( QString name )

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

helpContents += ')';
@@ -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;
}

@@ -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;

@@ -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;
}
@@ -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 );

@@ -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: " ) );
@@ -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 );
@@ -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;
@@ -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() )
@@ -63,7 +63,7 @@ QgsServerInterfaceImpl *QgsServer::sServerInterface = nullptr;
bool QgsServer::sInitialized = false;
QgsServerSettings QgsServer::sSettings;

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

QgsServer::QgsServer()
{
@@ -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 );
@@ -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 );
@@ -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

@@ -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() );
@@ -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;
@@ -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" );

0 comments on commit a102490

Please sign in to comment.
You can’t perform that action at this time.