diff options
Diffstat (limited to 'tools')
19 files changed, 49 insertions, 5 deletions
diff --git a/tools/assistant/lib/fulltextsearch/qanalyzer.cpp b/tools/assistant/lib/fulltextsearch/qanalyzer.cpp index 9c380ae..ed018bf 100644 --- a/tools/assistant/lib/fulltextsearch/qanalyzer.cpp +++ b/tools/assistant/lib/fulltextsearch/qanalyzer.cpp @@ -27,6 +27,7 @@ QCLuceneAnalyzerPrivate::QCLuceneAnalyzerPrivate(const QCLuceneAnalyzerPrivate & : QSharedData() { analyzer = _CL_POINTER(other.analyzer); + deleteCLuceneAnalyzer = other.deleteCLuceneAnalyzer; } QCLuceneAnalyzerPrivate::~QCLuceneAnalyzerPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qdocument.cpp b/tools/assistant/lib/fulltextsearch/qdocument.cpp index c2aae98..bad8ea9 100644 --- a/tools/assistant/lib/fulltextsearch/qdocument.cpp +++ b/tools/assistant/lib/fulltextsearch/qdocument.cpp @@ -29,6 +29,7 @@ QCLuceneDocumentPrivate::QCLuceneDocumentPrivate(const QCLuceneDocumentPrivate & : QSharedData() { document = _CL_POINTER(other.document); + deleteCLuceneDocument = other.deleteCLuceneDocument; } QCLuceneDocumentPrivate::~QCLuceneDocumentPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qfield.cpp b/tools/assistant/lib/fulltextsearch/qfield.cpp index 496622d..dc878f3 100644 --- a/tools/assistant/lib/fulltextsearch/qfield.cpp +++ b/tools/assistant/lib/fulltextsearch/qfield.cpp @@ -28,6 +28,7 @@ QCLuceneFieldPrivate::QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other) : QSharedData() { field = _CL_POINTER(other.field); + deleteCLuceneField = other.deleteCLuceneField; } QCLuceneFieldPrivate::~QCLuceneFieldPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qfilter.cpp b/tools/assistant/lib/fulltextsearch/qfilter.cpp index 60a2a1d..837f590 100644 --- a/tools/assistant/lib/fulltextsearch/qfilter.cpp +++ b/tools/assistant/lib/fulltextsearch/qfilter.cpp @@ -26,6 +26,7 @@ QCLuceneFilterPrivate::QCLuceneFilterPrivate(const QCLuceneFilterPrivate &other) : QSharedData() { filter = _CL_POINTER(other.filter); + deleteCLuceneFilter = other.deleteCLuceneFilter; } QCLuceneFilterPrivate::~QCLuceneFilterPrivate () diff --git a/tools/assistant/lib/fulltextsearch/qhits.cpp b/tools/assistant/lib/fulltextsearch/qhits.cpp index 003db17..c2fbf1b 100644 --- a/tools/assistant/lib/fulltextsearch/qhits.cpp +++ b/tools/assistant/lib/fulltextsearch/qhits.cpp @@ -27,6 +27,7 @@ QCLuceneHitsPrivate::QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other) : QSharedData() { hits = _CL_POINTER(other.hits); + deleteCLuceneHits = other.deleteCLuceneHits; } QCLuceneHitsPrivate::~QCLuceneHitsPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qindexreader.cpp b/tools/assistant/lib/fulltextsearch/qindexreader.cpp index a755eae..fc1a3bb 100644 --- a/tools/assistant/lib/fulltextsearch/qindexreader.cpp +++ b/tools/assistant/lib/fulltextsearch/qindexreader.cpp @@ -27,6 +27,7 @@ QCLuceneIndexReaderPrivate::QCLuceneIndexReaderPrivate(const QCLuceneIndexReader : QSharedData() { reader = _CL_POINTER(other.reader); + deleteCLuceneIndexReader = other.deleteCLuceneIndexReader; } QCLuceneIndexReaderPrivate::~QCLuceneIndexReaderPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qindexwriter.cpp b/tools/assistant/lib/fulltextsearch/qindexwriter.cpp index af5a7bb..93e23e7 100644 --- a/tools/assistant/lib/fulltextsearch/qindexwriter.cpp +++ b/tools/assistant/lib/fulltextsearch/qindexwriter.cpp @@ -27,6 +27,7 @@ QCLuceneIndexWriterPrivate::QCLuceneIndexWriterPrivate(const QCLuceneIndexWriter : QSharedData() { writer = _CL_POINTER(other.writer); + deleteCLuceneIndexWriter = other.deleteCLuceneIndexWriter; } QCLuceneIndexWriterPrivate::~QCLuceneIndexWriterPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qquery.cpp b/tools/assistant/lib/fulltextsearch/qquery.cpp index 8bc9607..1760b05 100644 --- a/tools/assistant/lib/fulltextsearch/qquery.cpp +++ b/tools/assistant/lib/fulltextsearch/qquery.cpp @@ -28,6 +28,7 @@ QCLuceneQueryPrivate::QCLuceneQueryPrivate(const QCLuceneQueryPrivate &other) : QSharedData() { query = _CL_POINTER(other.query); + deleteCLuceneQuery = other.deleteCLuceneQuery; } QCLuceneQueryPrivate::~QCLuceneQueryPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qqueryparser.cpp b/tools/assistant/lib/fulltextsearch/qqueryparser.cpp index cbe0147..6f546be 100644 --- a/tools/assistant/lib/fulltextsearch/qqueryparser.cpp +++ b/tools/assistant/lib/fulltextsearch/qqueryparser.cpp @@ -28,6 +28,7 @@ QCLuceneQueryParserPrivate::QCLuceneQueryParserPrivate(const QCLuceneQueryParser : QSharedData() { queryParser = _CL_POINTER(other.queryParser); + deleteCLuceneQueryParser = other.deleteCLuceneQueryParser; } QCLuceneQueryParserPrivate::~QCLuceneQueryParserPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qreader.cpp b/tools/assistant/lib/fulltextsearch/qreader.cpp index fe079a9..3b2d6f5 100644 --- a/tools/assistant/lib/fulltextsearch/qreader.cpp +++ b/tools/assistant/lib/fulltextsearch/qreader.cpp @@ -25,8 +25,9 @@ QCLuceneReaderPrivate::QCLuceneReaderPrivate() QCLuceneReaderPrivate::QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other) : QSharedData() -{ +{ reader = _CL_POINTER(other.reader); + deleteCLuceneReader = other.deleteCLuceneReader; } QCLuceneReaderPrivate::~QCLuceneReaderPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qsearchable.cpp b/tools/assistant/lib/fulltextsearch/qsearchable.cpp index c26868c..70cae91 100644 --- a/tools/assistant/lib/fulltextsearch/qsearchable.cpp +++ b/tools/assistant/lib/fulltextsearch/qsearchable.cpp @@ -26,6 +26,7 @@ QCLuceneSearchablePrivate::QCLuceneSearchablePrivate(const QCLuceneSearchablePri : QSharedData() { searchable = _CL_POINTER(other.searchable); + deleteCLuceneSearchable = other.deleteCLuceneSearchable; } QCLuceneSearchablePrivate::~QCLuceneSearchablePrivate() diff --git a/tools/assistant/lib/fulltextsearch/qsort.cpp b/tools/assistant/lib/fulltextsearch/qsort.cpp index 9c1e902..97ed128 100644 --- a/tools/assistant/lib/fulltextsearch/qsort.cpp +++ b/tools/assistant/lib/fulltextsearch/qsort.cpp @@ -27,6 +27,7 @@ QCLuceneSortPrivate::QCLuceneSortPrivate (const QCLuceneSortPrivate &other) : QSharedData() { sort = _CL_POINTER(other.sort); + deleteCLuceneSort = other.deleteCLuceneSort; } QCLuceneSortPrivate::~QCLuceneSortPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qterm.cpp b/tools/assistant/lib/fulltextsearch/qterm.cpp index 58d5c4d..10a2f3a 100644 --- a/tools/assistant/lib/fulltextsearch/qterm.cpp +++ b/tools/assistant/lib/fulltextsearch/qterm.cpp @@ -27,6 +27,7 @@ QCLuceneTermPrivate::QCLuceneTermPrivate(const QCLuceneTermPrivate &other) : QSharedData() { term = _CL_POINTER(other.term); + deleteCLuceneTerm = other.deleteCLuceneTerm; } QCLuceneTermPrivate::~QCLuceneTermPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qtoken.cpp b/tools/assistant/lib/fulltextsearch/qtoken.cpp index cc5296a..9056a7c 100644 --- a/tools/assistant/lib/fulltextsearch/qtoken.cpp +++ b/tools/assistant/lib/fulltextsearch/qtoken.cpp @@ -27,6 +27,7 @@ QCLuceneTokenPrivate::QCLuceneTokenPrivate(const QCLuceneTokenPrivate &other) : QSharedData() { token = _CL_POINTER(other.token); + deleteCLuceneToken = other.deleteCLuceneToken; } QCLuceneTokenPrivate::~QCLuceneTokenPrivate() diff --git a/tools/assistant/lib/fulltextsearch/qtokenstream.cpp b/tools/assistant/lib/fulltextsearch/qtokenstream.cpp index 8a98c08..0f4ab95 100644 --- a/tools/assistant/lib/fulltextsearch/qtokenstream.cpp +++ b/tools/assistant/lib/fulltextsearch/qtokenstream.cpp @@ -26,6 +26,7 @@ QCLuceneTokenStreamPrivate::QCLuceneTokenStreamPrivate(const QCLuceneTokenStream : QSharedData() { tokenStream = _CL_POINTER(other.tokenStream); + deleteCLuceneTokenStream = other.deleteCLuceneTokenStream; } QCLuceneTokenStreamPrivate::~QCLuceneTokenStreamPrivate() diff --git a/tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp index 99dfb9c..38e3501 100644 --- a/tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/tools/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -664,6 +664,9 @@ WidgetBoxTreeWidget::CategoryList WidgetBoxTreeWidget::loadCustomCategoryList() void WidgetBoxTreeWidget::adjustSubListSize(QTreeWidgetItem *cat_item) { QTreeWidgetItem *embedItem = cat_item->child(0); + if (embedItem == 0) + return; + WidgetBoxCategoryListView *list_widget = static_cast<WidgetBoxCategoryListView*>(itemWidget(embedItem, 0)); list_widget->setFixedWidth(header()->width()); list_widget->doItemsLayout(); diff --git a/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h b/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h index 0887a7c..8c54492 100644 --- a/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h +++ b/tools/designer/src/plugins/phononwidgets/videoplayertaskmenu.h @@ -47,7 +47,8 @@ #include <QtDesigner/QDesignerTaskMenuExtension> #include <QtDesigner/private/extensionfactory_p.h> -#include <phonon> +#include <Phonon/BackendCapabilities> +#include <Phonon/VideoPlayer> QT_BEGIN_NAMESPACE diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index 8ecdbc2..534bc11 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -80,6 +80,9 @@ static int usage(const QStringList &args) " -of <outformat>\n" " --output-format <outformat>\n" " Specify output format. See -if.\n\n" + " --input-codec <codec>\n" + " Specify encoding for .qm input files. Default is 'Latin1'.\n" + " UTF-8 is always tried as well, corresponding to the trUtf8() function.\n\n" " --drop-tags <regexp>\n" " Drop named extra tags when writing 'ts' or 'xlf' files.\n" " May be specified repeatedly.\n\n" @@ -138,6 +141,7 @@ int main(int argc, char *argv[]) Translator::LocationsType locations = Translator::DefaultLocations; ConversionData cd; + cd.m_codecForSource = "Latin1"; Translator tr; for (int i = 1; i < args.size(); ++i) { @@ -166,6 +170,10 @@ int main(int argc, char *argv[]) if (++i >= args.size()) return usage(args); inFormat = args[i]; + } else if (args[i] == QLatin1String("-input-codec")) { + if (++i >= args.size()) + return usage(args); + cd.m_codecForSource = args[i].toLatin1(); } else if (args[i] == QLatin1String("-drop-tag")) { if (++i >= args.size()) return usage(args); diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index 14f4c2c..323bd29 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -545,12 +545,20 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) size_t numItems = offsetLength / (2 * sizeof(quint32)); //qDebug() << "NUMITEMS: " << numItems; - // FIXME: that's just a guess, the original locale data is lost... - QTextCodec *codec = QTextCodec::codecForLocale(); + QTextCodec *codec = QTextCodec::codecForName(cd.m_codecForSource); QTextCodec *utf8Codec = 0; if (codec->name() != "UTF-8") utf8Codec = QTextCodec::codecForName("UTF-8"); + QString strProN = QLatin1String("%n"); + QLocale::Language l; + QLocale::Country c; + Translator::languageAndCountry(translator.languageCode(), &l, &c); + QStringList numerusForms; + bool guessPlurals = true; + if (getNumerusInfo(l, c, 0, &numerusForms)) + guessPlurals = (numerusForms.count() == 1); + QString context, contextUtf8; bool contextIsSystem, contextIsUtf8, contextNeeds8Bit; QString sourcetext, sourcetextUtf8; @@ -635,6 +643,15 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) end:; TranslatorMessage msg; msg.setType(TranslatorMessage::Finished); + if (translations.count() > 1) { + // If guessPlurals is not false here, plural form discard messages + // will be spewn out later. + msg.setPlural(true); + } else if (guessPlurals) { + // This might cause false positives, so it is a fallback only. + if (sourcetext.contains(strProN)) + msg.setPlural(true); + } msg.setTranslations(translations); translations.clear(); if (contextNeeds8Bit || sourcetextNeeds8Bit || commentNeeds8Bit) { @@ -649,7 +666,7 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) } if (!(contextIsSystem && sourcetextIsSystem && commentIsSystem)) { cd.appendError(QLatin1String( - "Cannot read file with current system character codec")); + "Cannot read file with specified input codec")); return false; } // The message is 8-bit in the file's encoding (utf-8 or not). |