diff --git a/article_netmgr.cc b/article_netmgr.cc index 7ca15408..6d0d3f5c 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -198,9 +198,6 @@ QNetworkReply * ArticleNetworkAccessManager::getArticleReply( QNetworkRequest co QUrl refererUrl = QUrl::fromEncoded( referer ); - //GD_DPRINTF( "Considering %s vs %s\n", getHostBase( req.url() ).toUtf8().data(), - // getHostBase( refererUrl ).toUtf8().data() ); - if ( !url.host().endsWith( refererUrl.host() ) && getHostBaseFromUrl( url ) != getHostBaseFromUrl( refererUrl ) && !url.scheme().startsWith("data") ) { @@ -449,7 +446,7 @@ qint64 ArticleResourceReply::readData( char * out, qint64 maxSize ) qint64 left = avail - alreadyRead; qint64 toRead = maxSize < left ? maxSize : left; - GD_DPRINTF( "====reading %d bytes\n", (int)toRead ); + GD_DPRINTF( "====reading %d bytes", (int)toRead ); try { @@ -457,7 +454,7 @@ qint64 ArticleResourceReply::readData( char * out, qint64 maxSize ) } catch( std::exception & e ) { - qWarning( "getDataSlice error: %s\n", e.what() ); + qWarning( "getDataSlice error: %s", e.what() ); } alreadyRead += toRead; diff --git a/articleview.cc b/articleview.cc index 2df8b49e..a5443044 100644 --- a/articleview.cc +++ b/articleview.cc @@ -1849,7 +1849,8 @@ void ArticleView::contextMenuRequested( QPoint const & pos ) if(text.size()) { - saveBookmark = new QAction( tr( "Save &Bookmark \"%1\"" ).arg( text.left( 60 ) ), &menu ); + // avoid too long in the menu ,use left 30 characters. + saveBookmark = new QAction( tr( "Save &Bookmark \"%1...\"" ).arg( text.left( 30 ) ), &menu ); menu.addAction( saveBookmark ); } @@ -1952,10 +1953,10 @@ void ArticleView::contextMenuRequested( QPoint const & pos ) QDesktopServices::openUrl( targetUrl ); else if ( result == lookupSelection ) - showDefinition( selectedText, getGroup( ui.definition->url() ), getCurrentArticle() ); + showDefinition( text, getGroup( ui.definition->url() ), getCurrentArticle() ); else if( result == saveBookmark ) { - emit saveBookmarkSignal( selectedText ); + emit saveBookmarkSignal( text.left( 60 ) ); } else if( result == sendToAnkiAction ) { diff --git a/indexedzip.cc b/indexedzip.cc index c5b77713..438700eb 100644 --- a/indexedzip.cc +++ b/indexedzip.cc @@ -64,7 +64,7 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data ) if ( !ZipFile::readLocalHeader( zip, header ) ) { - GD_DPRINTF( "Failed to load header\n" ); + GD_DPRINTF( "Failed to load header" ); return false; } @@ -73,13 +73,13 @@ bool IndexedZip::loadFile( uint32_t offset, vector< char > & data ) switch( header.compressionMethod ) { case ZipFile::Uncompressed: - GD_DPRINTF( "Uncompressed\n" ); + GD_DPRINTF( "Uncompressed" ); data.resize( header.uncompressedSize ); return (size_t) zip.read( &data.front(), data.size() ) == data.size(); case ZipFile::Deflated: { - GD_DPRINTF( "Deflated\n" ); + GD_DPRINTF( "Deflated" ); // Now do the deflation