mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-22 17:01:51 +02:00
Fix all the warnings! Almost.. in our own code...
This commit is contained in:
parent
82113c516f
commit
1e6e3a2cdd
CMakeLists.txt
src
CMakeLists.txtTomahawkApp.cpp
accounts
breakpad/CrashReporter
libtomahawk
AlbumPlaylistInterface.cppAtticaManager.cppCMakeLists.txtCountryUtils.hDropJob.cppSourceList.cppSourceList.h
accounts/spotify
audio
database
jobview
playlist
utils
widgets
widgets
thirdparty/breakpad
@ -40,7 +40,7 @@ ENDIF()
|
||||
IF( WITH_BREAKPAD )
|
||||
message(STATUS "Build with support for breakpad.")
|
||||
IF( CMAKE_COMPILER_IS_GNUCXX )
|
||||
ADD_DEFINITIONS( -DSTDC_HEADERS -std=gnu++98 )
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTDC_HEADERS -std=gnu++98" )
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
@ -105,18 +105,11 @@ INCLUDE_DIRECTORIES(
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
|
||||
audio
|
||||
database
|
||||
playlist
|
||||
network
|
||||
sourcetree
|
||||
topbar
|
||||
libtomahawk
|
||||
mac
|
||||
|
||||
${THIRDPARTY_DIR}/qxt/qxtweb-standalone/qxtweb
|
||||
${THIRDPARTY_DIR}/qtweetlib/qtweetlib/src
|
||||
${THIRDPARTY_DIR}/qtweetlib/tomahawk-custom
|
||||
${THIRDPARTY_DIR}/breakpad
|
||||
|
||||
${TAGLIB_INCLUDES}
|
||||
|
@ -741,7 +741,9 @@ TomahawkApp::notify( QObject *receiver, QEvent *e )
|
||||
catch ( const std::exception& e )
|
||||
{
|
||||
qWarning( "TomahawkApp::notify caught a std exception in a Qt event handler: " );
|
||||
qFatal( e.what() );
|
||||
|
||||
// the second parameter surpresses a format-security warning
|
||||
qFatal( e.what(), "" );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
|
@ -456,12 +456,6 @@ XmppSipPlugin::sendMsg( const QString& to, const SipInfo& info )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XmppSipPlugin::broadcastMsg( const QString& msg )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
XmppSipPlugin::addContact( const QString& jid, const QString& msg )
|
||||
{
|
||||
|
@ -91,7 +91,6 @@ public slots:
|
||||
virtual void sendMsg( const QString& peerId, const SipInfo& info );
|
||||
virtual void addContact( const QString& peerId, const QString& msg = QString() );
|
||||
|
||||
void broadcastMsg( const QString& msg );
|
||||
void showAddFriendDialog();
|
||||
void publishTune( const QUrl& url, const Tomahawk::InfoSystem::InfoStringHash& trackInfo );
|
||||
|
||||
|
@ -64,7 +64,7 @@ public slots:
|
||||
|
||||
void advertise();
|
||||
|
||||
void sendMsg( const QString& peerId , const SipInfo& ) {}
|
||||
void sendMsg( const QString&, const SipInfo& ) {}
|
||||
void broadcastMsg( const QString & ) {}
|
||||
void addContact( const QString &, const QString& ) {}
|
||||
|
||||
|
@ -13,7 +13,7 @@ QT4_WRAP_UI( crashreporter_UI_HEADERS ${crashreporter_UI} )
|
||||
QT4_ADD_RESOURCES( crashreporter_RC_RCC ${crashreporter_RC} )
|
||||
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/src ../../libtomahawk )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ../../libtomahawk )
|
||||
ADD_DEFINITIONS( ${QT_DEFINITIONS} )
|
||||
|
||||
ADD_EXECUTABLE( tomahawk_crash_reporter WIN32 ${crashreporter_SOURCES} ${crashreporter_HEADERS_MOC} ${crashreporter_UI_HEADERS} ${crashreporter_RC_RCC} )
|
||||
|
@ -108,7 +108,7 @@ bool
|
||||
AlbumPlaylistInterface::setCurrentTrack( unsigned int albumpos )
|
||||
{
|
||||
albumpos--;
|
||||
if ( albumpos >= m_queries.count() )
|
||||
if ( ( int ) albumpos >= m_queries.count() )
|
||||
return false;
|
||||
|
||||
m_currentTrack = albumpos;
|
||||
|
@ -303,6 +303,8 @@ AtticaManager::resolverData(const QString &atticaId) const
|
||||
void
|
||||
AtticaManager::providerError( QNetworkReply::NetworkError err )
|
||||
{
|
||||
Q_UNUSED( err );
|
||||
|
||||
// So those who care know
|
||||
emit resolversLoaded( Content::List() );
|
||||
}
|
||||
|
@ -172,6 +172,7 @@ set( libSources
|
||||
Album.cpp
|
||||
AlbumPlaylistInterface.cpp
|
||||
Collection.cpp
|
||||
CountryUtils.cpp
|
||||
FuncTimeout.cpp
|
||||
Playlist.cpp
|
||||
PlaylistPlaylistInterface.cpp
|
||||
|
@ -19,6 +19,8 @@
|
||||
#ifndef CHARTSPLUGIN_DATA_P_H
|
||||
#define CHARTSPLUGIN_DATA_P_H
|
||||
|
||||
#include "DllMacro.h"
|
||||
|
||||
#include <QtCore/qchar.h>
|
||||
#include <QLocale>
|
||||
|
||||
@ -777,27 +779,7 @@ static const quint16 country_name_index[] = {
|
||||
};
|
||||
|
||||
// Assumes that code is a 2 letter code
|
||||
static QString fullCountryFromCode(const QString& countryCode)
|
||||
{
|
||||
ushort uc1 = countryCode[0].toUpper().unicode();
|
||||
ushort uc2 = countryCode[1].toUpper().unicode();
|
||||
ushort uc3 = QChar('\0').unicode(); // No, not dealign with LatinAmericaAndTheCaribbean for convenience
|
||||
|
||||
const unsigned char *c = country_code_list;
|
||||
for (; *c != 0; c += 3) {
|
||||
if (uc1 == c[0] && uc2 == c[1] && uc3 == c[2])
|
||||
{
|
||||
uint country = (uint)((c - country_code_list)/3);
|
||||
|
||||
if (country > uint(QLocale::LastCountry))
|
||||
return QLatin1String("Unknown");
|
||||
|
||||
return QString(country_name_list + country_name_index[country]);
|
||||
}
|
||||
}
|
||||
|
||||
return QString("Unknown");
|
||||
}
|
||||
DLLEXPORT QString fullCountryFromCode(const QString& countryCode);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -850,6 +850,7 @@ DropJob::removeRemoteSources()
|
||||
QList< query_ptr >
|
||||
DropJob::getArtist( const QString &artist, Tomahawk::ModelMode mode )
|
||||
{
|
||||
Q_UNUSED( mode );
|
||||
artist_ptr artistPtr = Artist::get( artist );
|
||||
if ( artistPtr->playlistInterface( Mixed )->tracks().isEmpty() )
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ SourceList::SourceList( QObject* parent )
|
||||
|
||||
|
||||
const source_ptr&
|
||||
SourceList::getLocal()
|
||||
SourceList::getLocal() const
|
||||
{
|
||||
return m_local;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
|
||||
bool isReady() const { return m_isReady; }
|
||||
|
||||
const Tomahawk::source_ptr& getLocal();
|
||||
const Tomahawk::source_ptr& getLocal() const;
|
||||
void setLocal( const Tomahawk::source_ptr& localSrc );
|
||||
|
||||
void setWebSource( const Tomahawk::source_ptr& websrc );
|
||||
|
@ -122,6 +122,7 @@ SpotifyInfoPlugin::notInCacheSlot( InfoStringHash criteria, InfoRequestData requ
|
||||
void
|
||||
SpotifyInfoPlugin::albumListingResult( const QString& msgType, const QVariantMap& msg, const QVariant& extraData )
|
||||
{
|
||||
Q_UNUSED( msgType );
|
||||
Q_ASSERT( msg.contains( "qid" ) );
|
||||
Q_ASSERT( extraData.canConvert< InfoRequestData >() );
|
||||
|
||||
|
@ -83,8 +83,8 @@ SpotifyPlaylistUpdater::SpotifyPlaylistUpdater( SpotifyAccount* acct, const QStr
|
||||
, m_spotifyId( spotifyId )
|
||||
, m_blockUpdatesForNextRevision( false )
|
||||
, m_sync( false )
|
||||
, m_canSubscribe( false )
|
||||
, m_subscribed( false )
|
||||
, m_canSubscribe( false )
|
||||
, m_isOwner( false )
|
||||
, m_collaborative( false )
|
||||
, m_subscribers( 0 )
|
||||
|
@ -770,7 +770,7 @@ AudioEngine::onStateChanged( Phonon::State newState, Phonon::State oldState )
|
||||
tDebug( LOGVERBOSE ) << "Phonon state now:" << newState;
|
||||
if ( m_stateQueue.count() )
|
||||
{
|
||||
AudioState qState = m_stateQueue.dequeue();
|
||||
/*/ AudioState qState = */ m_stateQueue.dequeue();
|
||||
checkStateQueue();
|
||||
}
|
||||
}
|
||||
|
@ -62,8 +62,9 @@ TomahawkSqlQuery::prepare( const QString& query )
|
||||
bool
|
||||
TomahawkSqlQuery::exec( const QString& query )
|
||||
{
|
||||
bool prepareResult = prepare( query );
|
||||
//tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Query preparation successful?" << ( prepareResult ? "true" : "false" );
|
||||
// bool prepareResult =
|
||||
prepare( query );
|
||||
// tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Query preparation successful?" << ( prepareResult ? "true" : "false" );
|
||||
return exec();
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,7 @@ JobStatusView::customDelegateJobInserted( int row, JobStatusItem* item )
|
||||
void
|
||||
JobStatusView::customDelegateJobRemoved( int row )
|
||||
{
|
||||
Q_UNUSED( row );
|
||||
checkCount();
|
||||
}
|
||||
|
||||
|
@ -329,6 +329,7 @@ FlexibleView::onModelChanged()
|
||||
void
|
||||
FlexibleView::onWidgetDestroyed( QWidget* widget )
|
||||
{
|
||||
Q_UNUSED( widget );
|
||||
emit destroyed( this );
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,7 @@ void
|
||||
PlaylistModel::insertAlbums( const QList< Tomahawk::album_ptr >& albums, int row )
|
||||
{
|
||||
// FIXME: This currently appends, not inserts!
|
||||
Q_UNUSED( row );
|
||||
|
||||
foreach ( const album_ptr& album, albums )
|
||||
{
|
||||
@ -182,6 +183,7 @@ void
|
||||
PlaylistModel::insertArtists( const QList< Tomahawk::artist_ptr >& artists, int row )
|
||||
{
|
||||
// FIXME: This currently appends, not inserts!
|
||||
Q_UNUSED( row );
|
||||
|
||||
foreach ( const artist_ptr& artist, artists )
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
virtual void setRepeatMode( PlaylistModes::RepeatMode ) {}
|
||||
virtual void setShuffled( bool ) {}
|
||||
virtual bool shuffled() const { return false; }
|
||||
virtual result_ptr siblingItem( int itemsAway ) { return result_ptr(); }
|
||||
virtual result_ptr siblingItem( int ) { return result_ptr(); }
|
||||
virtual int trackCount() const { return 1; }
|
||||
virtual QList< query_ptr > tracks() { return QList< query_ptr >(); }
|
||||
|
||||
|
@ -42,6 +42,9 @@ public:
|
||||
virtual ~TreeProxyModel() {}
|
||||
|
||||
virtual void setSourcePlayableModel( TreeModel* model );
|
||||
// workaround overloaded-virtual warning
|
||||
virtual void setSourcePlayableModel( PlayableModel* ) { Q_ASSERT( false ); }
|
||||
|
||||
virtual Tomahawk::playlistinterface_ptr playlistInterface();
|
||||
|
||||
virtual void setFilter( const QString& pattern );
|
||||
@ -50,7 +53,10 @@ signals:
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent ) const;
|
||||
|
||||
bool lessThan( const QModelIndex& left, const QModelIndex& right ) const;
|
||||
// workaround overloaded-virtual warning: using this would lead to serious weirdness in release mode, sometimes an assert is simply not enough
|
||||
bool lessThan(int, const Tomahawk::query_ptr&, const Tomahawk::query_ptr&) const { Q_ASSERT(false); TomahawkUtils::crash(); return false; }
|
||||
|
||||
private slots:
|
||||
void onRowsInserted( const QModelIndex& parent, int start, int end );
|
||||
|
@ -31,7 +31,7 @@ namespace TomahawkUtils
|
||||
class ScopedDeleter
|
||||
{
|
||||
public:
|
||||
ScopedDeleter( QObject* o ) : m_o( 0 ) {}
|
||||
ScopedDeleter( QObject* o ) : m_o( o ) {}
|
||||
~ScopedDeleter() { m_o->deleteLater(); }
|
||||
|
||||
private:
|
||||
|
@ -111,6 +111,8 @@ JSPFLoader::networkLoadFinished()
|
||||
void
|
||||
JSPFLoader::networkError( QNetworkReply::NetworkError e )
|
||||
{
|
||||
Q_UNUSED( e );
|
||||
|
||||
reportError();
|
||||
|
||||
NetworkReply* r = qobject_cast<NetworkReply*>( sender() );
|
||||
|
@ -323,6 +323,8 @@ SpotifyParser::spotifyTrackLookupFinished()
|
||||
void
|
||||
SpotifyParser::playlistListingResult( const QString& msgType, const QVariantMap& msg, const QVariant& extraData )
|
||||
{
|
||||
Q_UNUSED( extraData );
|
||||
|
||||
Q_ASSERT( msgType == "playlistListing" );
|
||||
|
||||
m_title = msg.value( "name" ).toString();
|
||||
|
@ -82,17 +82,19 @@ private:
|
||||
void lookupSpotifyBrowse( const QString& playlist );
|
||||
void checkTrackFinished();
|
||||
void checkBrowseFinished();
|
||||
|
||||
|
||||
int m_limit;
|
||||
bool m_single;
|
||||
bool m_trackMode;
|
||||
bool m_createNewPlaylist;
|
||||
bool m_collaborative;
|
||||
bool m_createNewPlaylist;
|
||||
DropJobNotifier* m_browseJob;
|
||||
int m_subscribers;
|
||||
QList< query_ptr > m_tracks;
|
||||
QSet< NetworkReply* > m_queries;
|
||||
QString m_title, m_info, m_creator;
|
||||
Tomahawk::playlist_ptr m_playlist;
|
||||
DropJobNotifier* m_browseJob;
|
||||
QString m_browseUri;
|
||||
static QPixmap* s_pixmap;
|
||||
};
|
||||
|
@ -173,6 +173,8 @@ SourceTreePopupDialog::setExtraQuestions( const Tomahawk::PlaylistDeleteQuestion
|
||||
void
|
||||
SourceTreePopupDialog::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
|
||||
// Constants for painting
|
||||
const int leftTriangleWidth = 12;
|
||||
const int cornerRounding = TomahawkUtils::POPUP_ROUNDING_RADIUS;
|
||||
|
@ -163,6 +163,8 @@ AccountsToolButton::paintEvent( QPaintEvent* event )
|
||||
void
|
||||
AccountsToolButton::moveEvent( QMoveEvent* event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
|
||||
if ( m_popup )
|
||||
{
|
||||
if ( isDown() )
|
||||
|
@ -167,6 +167,8 @@ SlideSwitchButton::mouseMoveEvent( QMouseEvent* e )
|
||||
void
|
||||
SlideSwitchButton::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
|
||||
QPainter painter( this );
|
||||
painter.setRenderHint( QPainter::Antialiasing );
|
||||
|
||||
|
2
thirdparty/breakpad/CMakeLists.txt
vendored
2
thirdparty/breakpad/CMakeLists.txt
vendored
@ -7,7 +7,7 @@ set( CMAKE_MODULE_PATH
|
||||
)
|
||||
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
add_definitions(-DSTDC_HEADERS -std=gnu++98)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||
|
Loading…
x
Reference in New Issue
Block a user