Commit f47163df authored by armin's avatar armin
Browse files

Merge branch 'fixgccissue' into 'master'

iqw

See merge request !120
parents 7625e5b9 05b1d851
......@@ -31,13 +31,14 @@ int SortedVector<T>::insertSort( const QSharedPointer<T> &pointer )
this->append( pointer );
row = 0;
} else {
auto elementSmallerThanNew = std::lower_bound(this->begin(),this->end(),pointer,[](const auto &first, const auto &second)->bool{
return (*first)>(*second);
});
auto elementSmallerThanNew = std::lower_bound( this->begin(), this->end(), pointer, []( const auto & first, const auto & second )->bool{
return ( *first ) > ( *second );
} );
this->insert( elementSmallerThanNew, pointer );
row = elementSmallerThanNew - this->begin();
}
insert(elementSmallerThanNew, pointer);
row = elementSmallerThanNew-begin();
}
return row;
}
......@@ -45,11 +46,11 @@ template<typename T>
int SortedVector<T>::findInsertPosition( const QSharedPointer<T> &pointer ) const
{
int row = -1;
auto elementSmallerThanNew = std::lower_bound(this->begin(),this->end(),pointer,[](const auto &first, const auto &second)->bool{
return (*first)>(*second);
});
auto elementSmallerThanNew = std::lower_bound( this->begin(), this->end(), pointer, []( const auto & first, const auto & second )->bool{
return ( *first ) > ( *second );
} );
row = elementSmallerThanNew-begin();
row = elementSmallerThanNew - this->begin();
return row;
}
......@@ -57,17 +58,15 @@ int SortedVector<T>::findInsertPosition( const QSharedPointer<T> &pointer ) cons
template<typename T>
int SortedVector<T>::findPosition( const QSharedPointer<T> &pointer ) const
{
int row = -1;
auto pos = find(begin(),end(), pointer);
return pos - begin();
auto pos = find( this->begin(), this->end(), pointer );
return pos - this->begin();
}
template<typename T>
void SortedVector<T>::reOrder()
{
std::sort(this->begin(),this->end(),[=](const auto &first, const auto &second)->bool{
return (*first) >(*second);
});
std::sort( this->begin(), this->end(), [ = ]( const auto & first, const auto & second )->bool{
return ( *first ) > ( *second );
} );
}
......@@ -87,11 +87,11 @@ RocketChat::RocketChat( QGuiApplication *app )
#endif
qRegisterMetaType<ConnectionState>( "ConnectionState" );
qRegisterMetaType<Qt::ApplicationState>( "Qt::ApplicationState" );
qRegisterMetaType<RocketChatServerData*>( "RocketChatServerData*" );
qRegisterMetaType<RocketChatServerData *>( "RocketChatServerData*" );
// qInstallMessageHandler( customOutput );
qDebug()<<"threadId ctr"<<QThread::currentThreadId();
qDebug() << "threadId ctr" << QThread::currentThreadId();
}
RocketChat::~RocketChat()
......@@ -305,7 +305,7 @@ void RocketChat::deleteMessage( QString rid, QString id )
QMetaObject::invokeMethod( mServerMap.first(), "deleteMessage", Q_ARG( QString, rid ), Q_ARG( QString, id ) );
}
void RocketChat::resetConnection(void)
void RocketChat::resetConnection( void )
{
QMetaObject::invokeMethod( mServerMap.first(), "reconnect" );
}
......@@ -323,15 +323,15 @@ bool RocketChat::newServerByDomain( const QString &domain, bool pUnsecure = fals
mServerMap.clear();
if ( firstServer != nullptr ) {
connect( firstServer, &RocketChatServerData::destroyed, [ =,serverptr=this ]() {
connect( firstServer, &RocketChatServerData::destroyed, [ =, serverptr = this ]() {
qDebug() << "domain: " << domain;
Models::resetModels();
qDebug()<<"threadId destroyed"<<QThread::currentThreadId();
Models::resetModels();
qDebug() << "threadId destroyed" << QThread::currentThreadId();
RocketChatServerData *server = new RocketChatServerData( domain, domain, pUnsecure );
QMetaObject::invokeMethod(serverptr, "registerServer", Q_ARG(RocketChatServerData*, server ));
//registerServer( server );
newServerMutex.unlock();
RocketChatServerData *server = new RocketChatServerData( domain, domain, pUnsecure );
QMetaObject::invokeMethod( serverptr, "registerServer", Q_ARG( RocketChatServerData *, server ) );
//registerServer( server );
newServerMutex.unlock();
} );
QMetaObject::invokeMethod( firstServer, "deleteLater" );
......@@ -445,17 +445,17 @@ void RocketChat::openFileExternally( const QString &pPath )
#if defined( Q_OS_ANDROID)
QString q = pPath;
QAndroidJniObject jniObject = QAndroidJniObject::fromString(q);
QAndroidJniObject jniObject = QAndroidJniObject::fromString( q );
jstring j = jniObject.object<jstring>();
QtAndroid::androidActivity().callObjectMethod("openFile","(Ljava/lang/String;)Ljava/lang/String;",j);
QtAndroid::androidActivity().callObjectMethod( "openFile", "(Ljava/lang/String;)Ljava/lang/String;", j );
#elif defined(Q_OS_LINUX)
QDesktopServices::openUrl(pPath);
QDesktopServices::openUrl( pPath );
#elif defined (Q_OS_IOS)
emit openIOSFileDialog( pPath );
#elif defined(Q_OS_WIN)
QDesktopServices::openUrl(pPath);
QDesktopServices::openUrl( pPath );
#elif defined(Q_OS_MACOS)
QDesktopServices::openUrl(pPath);
QDesktopServices::openUrl( pPath );
#endif
......@@ -608,7 +608,7 @@ void RocketChat::createPrivateGroup( const QString &pServerId, const QString &pC
void RocketChat::registerServer( RocketChatServerData *pServer )
{
qDebug()<<"threadId register"<<QThread::currentThreadId();
qDebug() << "threadId register" << QThread::currentThreadId();
pServer->moveToThread( &mServerThread );
qDebug() << "add server to map";
......@@ -671,7 +671,7 @@ void RocketChat::onUnreadCountChanged( const QString &pServerId, uint pUnread )
mUnreadSum[pServerId] = pUnread;
// qDebug() << "onUnreadCountChanged";
uint number = 0;
int number = 0;
if ( mServerStatus ) {
for ( auto count : mUnreadSum ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment