diff --git a/aard.cc b/aard.cc index e41433c7..5a2d9e8b 100644 --- a/aard.cc +++ b/aard.cc @@ -940,8 +940,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( quint16 volumes = qFromBigEndian( dictHeader.totalVolumes ); if( volumes > 1 ) { - QString ss; - ss.sprintf( " (%i/%i)", qFromBigEndian( dictHeader.volume ), volumes ); + QString ss=QString( " (%1/%2)").arg( qFromBigEndian( dictHeader.volume ), volumes ); dictName += ss.toLocal8Bit().data(); } diff --git a/article_netmgr.cc b/article_netmgr.cc index c88d1d22..ae74740b 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -32,7 +32,7 @@ using std::string; connect( baseReply, SIGNAL( metaDataChanged() ), this, SLOT( applyMetaData() ) ); - connect( baseReply, SIGNAL( error( QNetworkReply::NetworkError) ), + connect( baseReply, SIGNAL( errorOccurred( QNetworkReply::NetworkError) ), this, SLOT( applyError( QNetworkReply::NetworkError ) ) ); connect( baseReply, SIGNAL( readyRead() ), this, SLOT( readDataFromBase() ) ); @@ -113,8 +113,8 @@ using std::string; baseReply->attribute( QNetworkRequest::HttpPipeliningWasUsedAttribute ) ); setAttribute( QNetworkRequest::BackgroundRequestAttribute, baseReply->attribute( QNetworkRequest::BackgroundRequestAttribute ) ); - setAttribute( QNetworkRequest::SpdyWasUsedAttribute, - baseReply->attribute( QNetworkRequest::SpdyWasUsedAttribute ) ); + setAttribute( QNetworkRequest::Http2WasUsedAttribute, + baseReply->attribute( QNetworkRequest::Http2WasUsedAttribute ) ); emit metaDataChanged(); } @@ -133,7 +133,7 @@ using std::string; void AllowFrameReply::applyError( QNetworkReply::NetworkError code ) { setError( code, baseReply->errorString() ); - emit error( code ); + emit errorOccurred( code ); } void AllowFrameReply::readDataFromBase() @@ -283,7 +283,7 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op, QNetworkRequest newReq(req); if ( hideGoldenDictHeader && req.url().scheme().startsWith("http", Qt::CaseInsensitive)) { - newReq.setRawHeader("User-Agent", req.rawHeader("User-Agent").replace(qApp->applicationName(), "")); + newReq.setRawHeader("User-Agent", req.rawHeader("User-Agent").replace(qApp->applicationName().toUtf8(), "")); } QNetworkReply * reply = QNetworkAccessManager::createRequest( op, newReq, outgoingData ); @@ -336,8 +336,8 @@ sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource( // See if we have some dictionaries muted - QSet< QString > mutedDicts = - QSet< QString >::fromList( Utils::Url::queryItemValue( url, "muted" ).split( ',' ) ); + QStringList mutedDictLists=Utils::Url::queryItemValue( url, "muted" ).split( ',' ); + QSet< QString > mutedDicts ( mutedDictLists.begin(),mutedDictLists.end()); // Unpack contexts @@ -525,7 +525,7 @@ void ArticleResourceReply::readyReadSlot() void ArticleResourceReply::finishedSlot() { if (req->dataSize() < 0) { - emit error(ContentNotFoundError); + emit errorOccurred(ContentNotFoundError); setError(ContentNotFoundError, "content not found"); } diff --git a/articleview.cc b/articleview.cc index aa6383e8..57979517 100644 --- a/articleview.cc +++ b/articleview.cc @@ -856,15 +856,17 @@ bool ArticleView::eventFilter( QObject * obj, QEvent * ev ) int delta = result == Gestures::SWIPE_UP ? -120 : 120; QWidget *widget = static_cast< QWidget * >( obj ); + QPoint angleDelta(0, delta); + QPoint pixelDetal; QWidget *child = widget->childAt( widget->mapFromGlobal( pt ) ); if( child ) { - QWheelEvent whev( child->mapFromGlobal( pt ), pt, delta, Qt::NoButton, Qt::NoModifier ); + QWheelEvent whev( child->mapFromGlobal( pt ), pt, pixelDetal,angleDelta, Qt::NoButton, Qt::NoModifier,Qt::NoScrollPhase,false); qApp->sendEvent( child, &whev ); } else { - QWheelEvent whev( widget->mapFromGlobal( pt ), pt, delta, Qt::NoButton, Qt::NoModifier ); + QWheelEvent whev( widget->mapFromGlobal( pt ), pt,pixelDetal, angleDelta,Qt::NoButton, Qt::NoModifier,Qt::NoScrollPhase,false ); qApp->sendEvent( widget, &whev ); } } diff --git a/articlewebview.cc b/articlewebview.cc index 126f2890..392d4b01 100644 --- a/articlewebview.cc +++ b/articlewebview.cc @@ -98,7 +98,7 @@ bool ArticleWebView::eventFilter(QObject *obj, QEvent *ev) { void ArticleWebView::mousePressEvent(QMouseEvent *event) { - if (event->buttons() & Qt::MidButton) + if (event->buttons() & Qt::MiddleButton) midButtonPressed = true; } @@ -127,7 +127,7 @@ void ArticleWebView::sendCustomMouseEvent( QEvent::Type type) { } void ArticleWebView::mouseReleaseEvent(QMouseEvent *event) { - bool noMidButton = !( event->buttons() & Qt::MidButton ); + bool noMidButton = !( event->buttons() & Qt::MiddleButton ); if ( midButtonPressed & noMidButton ) midButtonPressed = false; @@ -169,7 +169,7 @@ void ArticleWebView::wheelEvent( QWheelEvent *ev ) SystemParametersInfo( SPI_GETWHEELSCROLLLINES, 0, &nLines, 0 ); if( nLines == WHEEL_PAGESCROLL ) { - QKeyEvent kev( QEvent::KeyPress, ev->delta() > 0 ? Qt::Key_PageUp : Qt::Key_PageDown, + QKeyEvent kev( QEvent::KeyPress, ev->angleDelta ().y () > 0 ? Qt::Key_PageUp : Qt::Key_PageDown, Qt::NoModifier ); auto childrens = this->children(); for (auto child : childrens) { diff --git a/btreeidx.cc b/btreeidx.cc index ab6dfc93..9fc70a0e 100644 --- a/btreeidx.cc +++ b/btreeidx.cc @@ -1437,16 +1437,17 @@ void BtreeIndex::getHeadwordsFromOffsets( QList & offsets, for( unsigned i = 0; i < result.size(); i++ ) { - QList< uint32_t >::Iterator it = qBinaryFind( begOffsets, endOffsets, - result.at( i ).articleOffset ); + uint32_t articleOffset = result.at(i).articleOffset; + QList::Iterator it = std::lower_bound( begOffsets, endOffsets, + articleOffset ); - if( it != offsets.end() ) + if( it!=offsets.end()) { if( isCancelled && Utils::AtomicInt::loadAcquire( *isCancelled ) ) return; headwords.append( QString::fromUtf8( ( result[ i ].prefix + result[ i ].word ).c_str() ) ); - offsets.erase( it ); + offsets.erase( it); begOffsets = offsets.begin(); endOffsets = offsets.end(); } diff --git a/dictionary.cc b/dictionary.cc index 4a185564..56755c4e 100644 --- a/dictionary.cc +++ b/dictionary.cc @@ -487,13 +487,13 @@ bool needToRebuildIndex( vector< string > const & dictionaryFiles, ZipFile::SplitZipFile zf( name ); if( !zf.exists() ) return true; - ts = zf.lastModified().toTime_t(); + ts = zf.lastModified().toSecsSinceEpoch(); } else { if ( !fileInfo.exists() ) return true; - ts = fileInfo.lastModified().toTime_t(); + ts = fileInfo.lastModified().toSecsSinceEpoch(); } if ( ts > lastModified ) @@ -505,7 +505,7 @@ bool needToRebuildIndex( vector< string > const & dictionaryFiles, if ( !fileInfo.exists() ) return true; - return fileInfo.lastModified().toTime_t() < lastModified; + return fileInfo.lastModified().toSecsSinceEpoch() < lastModified; } QString generateRandomDictionaryId() diff --git a/dictionarybar.cc b/dictionarybar.cc index 74ff65f1..8ad0ad0c 100644 --- a/dictionarybar.cc +++ b/dictionarybar.cc @@ -211,7 +211,7 @@ void DictionaryBar::showContextMenu( QContextMenuEvent * event, bool extended ) { QString command( editDictionaryCommand ); command.replace( "%GDDICT%", "\"" + dictFilename + "\"" ); - if( !QProcess::startDetached( command ) ) + if( !QProcess::startDetached( command ,QStringList()) ) QApplication::beep(); } diff --git a/epwing.cc b/epwing.cc index fa61ed53..e3979ec5 100644 --- a/epwing.cc +++ b/epwing.cc @@ -957,9 +957,7 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< sptr< Dictionary::Class > > dictionaries; vector< string > dictFiles; - QByteArray catName; - catName += QDir::separator(); - catName += "catalogs"; + QByteArray catName = QString("%1catalogs").arg(QDir::separator()).toUtf8(); for( vector< string >::const_iterator i = fileNames.begin(); i != fileNames.end(); ++i ) diff --git a/epwing_book.cc b/epwing_book.cc index 18f38298..16d99353 100644 --- a/epwing_book.cc +++ b/epwing_book.cc @@ -1732,8 +1732,7 @@ QByteArray EpwingBook::handleReference( EB_Hook_Code code, const unsigned int * if( refOpenCount > refCloseCount ) return QByteArray(); - QString str; - str.sprintf( "", refOpenCount ); + QString str=QString( "").arg( refOpenCount ); refOpenCount += 1; return str.toUtf8(); } @@ -1747,7 +1746,7 @@ QByteArray EpwingBook::handleReference( EB_Hook_Code code, const unsigned int * refOffsets.append( argv[ 2 ] ); QString str; - str.sprintf( "", refCloseCount ); + str.asprintf( "", refCloseCount ); refCloseCount += 1; return str.toUtf8(); diff --git a/extlineedit.cc b/extlineedit.cc index ecaa7bda..e2ba7de3 100644 --- a/extlineedit.cc +++ b/extlineedit.cc @@ -110,14 +110,12 @@ void ExtLineEdit::updateButtonPositions() iconPos = (iconPos == Left ? Right : Left); if (iconPos == ExtLineEdit::Right) { - int right; - getTextMargins(0, 0, &right, 0); - const int iconoffset = right + 4; + QMargins qm=textMargins(); + const int iconoffset = qm.right() + 4; iconButtons[i]->setGeometry(contentRect.adjusted(width() - iconoffset, 0, 0, 0)); } else { - int left; - getTextMargins(&left, 0, 0, 0); - const int iconoffset = left + 4; + QMargins qm=textMargins(); + const int iconoffset = qm.left() + 4; iconButtons[i]->setGeometry(contentRect.adjusted(0, 0, -width() + iconoffset, 0)); } } diff --git a/favoritespanewidget.cc b/favoritespanewidget.cc index 392b4156..bb8cf343 100644 --- a/favoritespanewidget.cc +++ b/favoritespanewidget.cc @@ -907,7 +907,9 @@ void FavoritesModel::removeItemsForIndexes( const QModelIndexList & idxList ) for( int i = lowestLevel; i >= 0; i-- ) { QModelIndexList idxSublist = itemsToDelete[ i ]; - std::sort( idxSublist.begin(), idxSublist.end(), qGreater< QModelIndex >() ); + //std::greater does not work ,operator < not implemented ,use std:less first ,then std::reverse. + std::sort(idxSublist.begin(), idxSublist.end(), std::less()); + std::reverse(idxSublist.begin(), idxSublist.end()); it = idxSublist.begin(); for( ; it != idxSublist.end(); ++it ) diff --git a/fulltextsearch.cc b/fulltextsearch.cc index a7ad4595..02b24dce 100644 --- a/fulltextsearch.cc +++ b/fulltextsearch.cc @@ -17,6 +17,7 @@ #include "initializing.hh" #include #include +#include #endif @@ -248,8 +249,7 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent, oldBarStyle = 0; - if( QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA - && ( QSysInfo::windowsVersion() & QSysInfo::WV_NT_based ) + if( QOperatingSystemVersion::current () >= QOperatingSystemVersion::Windows7 && !IsThemeActive() ) { QStyle * barStyle = WindowsStyle::instance().getStyle(); @@ -649,7 +649,7 @@ Q_UNUSED( parent ); for( int x = 0; x < hws.length(); x++ ) { - QList< FtsHeadword >::iterator it = qBinaryFind( headwords.begin(), headwords.end(), hws.at( x ) ); + QList< FtsHeadword >::iterator it = std::lower_bound( headwords.begin(), headwords.end(), hws.at( x ) ); if( it != headwords.end() ) { it->dictIDs.push_back( hws.at( x ).dictIDs.front() ); diff --git a/gddebug.cc b/gddebug.cc index 57cd7ab1..7c08f5c0 100644 --- a/gddebug.cc +++ b/gddebug.cc @@ -23,7 +23,7 @@ QTextCodec *localeCodec = 0; QTextCodec::setCodecForLocale( utf8Codec ); } - qWarning( "%s", QString().vsprintf( msg, ap ).toUtf8().data() ); + qWarning( "%s", QString().vasprintf( msg, ap ).toUtf8().data() ); if( logFilePtr && logFilePtr->isOpen() ) { @@ -48,7 +48,7 @@ QTextCodec *localeCodec = 0; QTextCodec::setCodecForLocale( utf8Codec ); } - qDebug( "%s", QString().vsprintf( msg, ap ).toUtf8().data() ); + qDebug( "%s", QString().vasprintf( msg, ap ).toUtf8().data() ); if( logFilePtr && logFilePtr->isOpen() ) { diff --git a/goldendict.pro b/goldendict.pro index 04530b7e..9e3d8ec3 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -29,6 +29,8 @@ QT += widgets \ printsupport \ help +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050F00 + # QMediaPlayer is not available in Qt4. !CONFIG( no_qtmultimedia_player ) { QT += multimedia diff --git a/groups_widgets.cc b/groups_widgets.cc index ef9079a4..851b6ba4 100644 --- a/groups_widgets.cc +++ b/groups_widgets.cc @@ -744,8 +744,8 @@ void DictGroupsWidget::addAutoGroups() dictMap[ name ] = vd; } - QStringList groupList = dictMap.uniqueKeys(); - QStringList morphoList = morphoMap.uniqueKeys(); + QStringList groupList = dictMap.keys(); + QStringList morphoList = morphoMap.keys(); // Insert morphology dictionaries into corresponding lists diff --git a/helpwindow.cc b/helpwindow.cc index 9652fb7f..8630afcb 100644 --- a/helpwindow.cc +++ b/helpwindow.cc @@ -11,6 +11,7 @@ #include "helpwindow.hh" #include "gddebug.hh" +#include namespace Help { @@ -25,9 +26,11 @@ void HelpBrowser::showHelpForKeyword( QString const & id ) { if ( helpEngine ) { - QMap< QString, QUrl > links = helpEngine->linksForIdentifier( id ); - if( !links.isEmpty() ) - setSource( links.constBegin().value() ); + QList links = helpEngine->documentsForIdentifier(id); + if (!links.isEmpty()) { + QHelpLink link=links.constFirst(); + setSource(link.url); + } } } diff --git a/hotkeyedit.cc b/hotkeyedit.cc index cf255dde..6ba4f27d 100644 --- a/hotkeyedit.cc +++ b/hotkeyedit.cc @@ -87,7 +87,7 @@ void HotKeyEdit::keyPressEvent( QKeyEvent * event ) // Delete current combo currentKey1 = 0; currentKey2 = 0; - currentModifiers = 0; + currentModifiers = Qt::NoModifier; continuingCombo = false; } else diff --git a/initializing.cc b/initializing.cc index e6d68b4f..8d1d4a81 100644 --- a/initializing.cc +++ b/initializing.cc @@ -8,6 +8,7 @@ #if defined( Q_OS_WIN32 ) #include #include +#include WindowsStyle::WindowsStyle() { @@ -41,8 +42,7 @@ Initializing::Initializing( QWidget * parent, bool showOnStartup ): QDialog( par oldBarStyle = 0; - if( QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA - && ( QSysInfo::windowsVersion() & QSysInfo::WV_NT_based ) + if( QOperatingSystemVersion::current () >= QOperatingSystemVersion::Windows7 && !IsThemeActive() ) { QStyle * barStyle = WindowsStyle::instance().getStyle(); diff --git a/mainstatusbar.cc b/mainstatusbar.cc index fe41655b..47ea5f22 100644 --- a/mainstatusbar.cc +++ b/mainstatusbar.cc @@ -43,7 +43,7 @@ MainStatusBar::MainStatusBar( QWidget *parent ) : QWidget( parent ) bool MainStatusBar::hasImage() const { - return !picWidget->pixmap()->isNull(); + return !picWidget->pixmap().isNull(); } void MainStatusBar::clearMessage() @@ -92,7 +92,7 @@ void MainStatusBar::refresh() { adjustSize(); - if ( !picWidget->pixmap()->isNull() ) + if ( !picWidget->pixmap().isNull() ) { picWidget->setFixedSize( textWidget->height(), textWidget->height() ); } diff --git a/maintabwidget.cc b/maintabwidget.cc index fdf3ca15..0d15f9d1 100644 --- a/maintabwidget.cc +++ b/maintabwidget.cc @@ -67,7 +67,7 @@ bool MainTabWidget::eventFilter( QObject * obj, QEvent * ev ) if( obj == tabBar() && ev->type() == QEvent::MouseButtonPress ) { QMouseEvent * mev = static_cast< QMouseEvent *>( ev ); - if( mev->button() == Qt::MidButton ) + if( mev->button() == Qt::MiddleButton ) { emit tabCloseRequested( tabBar()->tabAt( mev->pos() ) ); return true; diff --git a/mainwindow.cc b/mainwindow.cc index e5208bf3..c584e16d 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -741,7 +741,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ): #ifdef Q_OS_WIN if( cfg.normalMainWindowGeometry.width() <= 0 ) { - QRect r = QApplication::desktop()->availableGeometry(); + QRect r = QGuiApplication::primaryScreen ()->geometry (); cfg.normalMainWindowGeometry.setRect( r.width() / 4, r.height() / 4, r.width() / 2, r.height() / 2 ); } if( cfg.maximizedMainWindowGeometry.width() > 0 ) @@ -975,7 +975,7 @@ void MainWindow::mousePressEvent( QMouseEvent *event) return; } - if (event->button() != Qt::MidButton) + if (event->button() != Qt::MiddleButton) return QMainWindow::mousePressEvent(event); // middle clicked @@ -1194,11 +1194,11 @@ void MainWindow::wheelEvent( QWheelEvent *ev ) { if ( ev->modifiers().testFlag( Qt::ControlModifier ) ) { - if ( ev->delta() > 0 ) + if ( ev->angleDelta().y() > 0 ) { zoomin(); } - else if ( ev->delta() < 0 ) + else if ( ev->angleDelta().y() < 0 ) { zoomout(); } @@ -4363,12 +4363,11 @@ void MainWindow::editDictionary( Dictionary::Class * dict ) QString headword = unescapeTabHeader( ui.tabWidget->tabText( ui.tabWidget->currentIndex() ) ); command.replace( "%GDWORD%", headword ); } - if( !QProcess::startDetached( command ) ) + if( !QProcess::startDetached( command,QStringList() ) ) QApplication::beep(); } } - void MainWindow::openDictionaryFolder( const QString & id ) { for( unsigned x = 0; x < dictionaries.size(); x++ ) diff --git a/mainwindow.hh b/mainwindow.hh index c61f3c83..37b25198 100644 --- a/mainwindow.hh +++ b/mainwindow.hh @@ -524,7 +524,7 @@ class ArticleSaveProgressDialog : public QProgressDialog Q_OBJECT public: - explicit ArticleSaveProgressDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 ): + explicit ArticleSaveProgressDialog( QWidget * parent = 0, Qt::WindowFlags f = Qt::Widget ): QProgressDialog( parent, f ) { setAutoReset( false ); diff --git a/mdictparser.cc b/mdictparser.cc index ca044e70..ca0ae455 100644 --- a/mdictparser.cc +++ b/mdictparser.cc @@ -357,7 +357,7 @@ bool MdictParser::readHeader( QDataStream & in ) if ( headerAttributes.contains( "StyleSheet" ) ) { QString styleSheets = headerAttributes.namedItem( "StyleSheet" ).toAttr().value(); - QStringList lines = styleSheets.split( QRegularExpression( "[\r\n]" ), QString::KeepEmptyParts ); + QStringList lines = styleSheets.split( QRegularExpression( "[\r\n]" ), Qt::KeepEmptyParts ); for ( int i = 0; i < lines.size() - 3; i += 3 ) { diff --git a/preferences.cc b/preferences.cc index 6be59a98..e3c53a4c 100644 --- a/preferences.cc +++ b/preferences.cc @@ -77,7 +77,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): if ( lang == "qt" ) continue; // We skip qt's own localizations - sortedLocs.insertMulti( + sortedLocs.insert( Language::localizedNameForId( LangCoder::code2toInt( lang.toLatin1().data() ) ), QPair< QIcon, QString >( QIcon( QString( ":/flags/%1.png" ).arg( i->mid( 3, 2 ).toLower() ) ), @@ -122,7 +122,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): reg = lang.toUpper(); } - sortedHelps.insertMulti( + sortedHelps.insert( Language::localizedNameForId( LangCoder::code2toInt( lang.toLatin1().data() ) ), QPair< QIcon, QString >( QIcon( QString( ":/flags/%1.png" ).arg( reg.toLower() ) ), lang + "_" + reg ) ); diff --git a/scanflag.cc b/scanflag.cc index 346f45ce..13982b42 100644 --- a/scanflag.cc +++ b/scanflag.cc @@ -3,6 +3,7 @@ #include "scanflag.hh" #include "ui_scanflag.h" +#include static Qt::WindowFlags popupWindowFlags = @@ -53,7 +54,7 @@ void ScanFlag::showScanFlag() QPoint currentPos = QCursor::pos(); - QRect desktop = QApplication::desktop()->screenGeometry(); + QRect desktop = QGuiApplication::primaryScreen()->geometry(); QSize windowSize = geometry().size(); diff --git a/scanpopup.cc b/scanpopup.cc index e61fd4f9..d958a26d 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -625,7 +625,7 @@ void ScanPopup::engagePopup( bool forcePopup, bool giveFocus ) QPoint currentPos = QCursor::pos(); - QRect desktop = QApplication::desktop()->screenGeometry(); + QRect desktop = QGuiApplication::primaryScreen()->geometry(); QSize windowSize = geometry().size(); diff --git a/slob.cc b/slob.cc index 8420f642..fe53be06 100644 --- a/slob.cc +++ b/slob.cc @@ -902,7 +902,7 @@ string SlobDictionary::convert( const string & in, RefEntry const & entry ) || list[ 1 ].endsWith( " tex" ) ) { QString name; - name.sprintf( "%04X%04X%04X.gif", entry.itemIndex, entry.binIndex, texCount ); + name.asprintf( "%04X%04X%04X.gif", entry.itemIndex, entry.binIndex, texCount ); imgName = texCachePath + "/" + name; if( !QFileInfo( imgName ).exists() ) @@ -985,7 +985,7 @@ string SlobDictionary::convert( const string & in, RefEntry const & entry ) QString command = texCgiPath + " -e " + imgName + " \"" + tex + "\""; - QProcess::execute( command ); + QProcess::execute( command,QStringList() ); } QString tag = QString( "resizeColumnToContents( 0 ); // Make sure this thing will be large enough ui.programs->setColumnWidth( 1, - QFontMetrics( QFont() ).width( + QFontMetrics( QFont() ).horizontalAdvance( ProgramTypeEditor::getNameForType( Config::Program::PrefixMatch ) ) + 16 ); ui.programs->resizeColumnToContents( 2 ); ui.programs->resizeColumnToContents( 3 ); diff --git a/translatebox.cc b/translatebox.cc index 67944754..521e973e 100644 --- a/translatebox.cc +++ b/translatebox.cc @@ -107,7 +107,7 @@ TranslateBox::TranslateBox(QWidget *parent) : QWidget(parent), QHBoxLayout *layout = new QHBoxLayout(this); setLayout(layout); - layout->setMargin(0); + layout->setContentsMargins(0,0,0,0); layout->addWidget(translate_line); QPixmap image(":/icons/system-search.svg"); diff --git a/website.cc b/website.cc index 5167c55f..57431950 100644 --- a/website.cc +++ b/website.cc @@ -369,7 +369,7 @@ sptr< DataRequest > WebSiteDictionary::getArticle( wstring const & str, { codec = QTextCodec::codecForName( QString( "ISO 8859-%1" ).arg( x ).toLatin1() ); if( codec ) - urlString.replace( QString( "%25GDISO%1%25" ).arg( x ), codec->fromUnicode( inputWord ).toPercentEncoding() ); + urlString.replace( QString( "%25GDISO%1%25" ).arg( x ).toUtf8(), codec->fromUnicode( inputWord ).toPercentEncoding() ); if ( x == 10 ) x = 12; // Skip encodings 11..12, they don't exist diff --git a/zipfile.cc b/zipfile.cc index 837eb497..04a43b0c 100644 --- a/zipfile.cc +++ b/zipfile.cc @@ -242,11 +242,11 @@ QDateTime SplitZipFile::lastModified() const unsigned long ts = 0; for( QVector< QFile * >::const_iterator i = files.begin(); i != files.end(); ++i ) { - unsigned long t = QFileInfo( (*i)->fileName() ).lastModified().toTime_t(); + unsigned long t = QFileInfo( (*i)->fileName() ).lastModified().toSecsSinceEpoch(); if( t > ts ) ts = t; } - return QDateTime::fromTime_t( ts ); + return QDateTime::fromSecsSinceEpoch( ts ); } qint64 SplitZipFile::calcAbsoluteOffset( qint64 offset, quint16 partNo )