Exemple #1
0
static QString m_defaultExtensions;

static void printOut(const QString & out)
{
    QTextStream stream(stdout);
    stream << out;
}

static void printErr(const QString & out)
{
    QTextStream stream(stderr);
    stream << out;
}

class LU {
    Q_DECLARE_TR_FUNCTIONS(LUpdate)
};

static void recursiveFileInfoList(const QDir &dir,
    const QSet<QString> &nameFilters, QDir::Filters filter,
    QFileInfoList *fileinfolist)
{
    foreach (const QFileInfo &fi, dir.entryInfoList(filter))
        if (fi.isDir())
            recursiveFileInfoList(QDir(fi.absoluteFilePath()), nameFilters, filter, fileinfolist);
        else if (nameFilters.contains(fi.suffix()))
            fileinfolist->append(fi);
}

static void printUsage()
{
Exemple #2
0
#include "translator.h"

#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QTranslator>
#include <QtCore/QLibraryInfo>

#include <iostream>

QT_USE_NAMESPACE

class LC {
    Q_DECLARE_TR_FUNCTIONS(LConvert)
};

static int usage(const QStringList &args)
{
    Q_UNUSED(args);

    QString loaders;
    QString line(QLatin1String("    %1 - %2\n"));
    foreach (Translator::FileFormat format, Translator::registeredFileFormats())
        loaders += line.arg(format.extension, -5).arg(format.description);

    std::cerr << qPrintable(LC::tr("\nUsage:\n"
        "    lconvert [options] <infile> [<infile>...]\n\n"
        "lconvert is part of Qt's Linguist tool chain. It can be used as a\n"
        "stand-alone tool to convert and filter translation data files.\n"
Exemple #3
0
****************************************************************************/

#include <QCoreApplication>
#include <QFile>
#include <QHash>
#include <QPair>
#include <QStringList>
#include <QTextStream>
#include <QXmlStreamReader>

/*
    This class exists for the sole purpose of creating a translation context.
 */
class PrettyPrint
{
    Q_DECLARE_TR_FUNCTIONS(PrettyPrint)
};

int main(int argc, char *argv[])
{
    enum ExitCode
    {
        Success,
        ParseFailure,
        ArgumentError,
        WriteError,
        FileFailure
    };

    QCoreApplication app(argc, argv);
Exemple #4
0
#include <QtCore/QMap>
#include <QtCore/QFileInfo>
#include <QtCore/QDateTime>
#include <QtCore/QBuffer>
#include <QtCore/QTranslator>
#include <QtCore/QLocale>
#include <QtCore/QLibraryInfo>
#include <QtHelp/QHelpEngineCore>
#include <QtCore/QXmlStreamReader>

#include <QtGui/QGuiApplication>

QT_USE_NAMESPACE

class QCG {
    Q_DECLARE_TR_FUNCTIONS(QCollectionGenerator)
};

class CollectionConfigReader : public QXmlStreamReader
{
public:
    void readData(const QByteArray &contents);

    QString title() const {
        return m_title;
    }
    QString homePage() const {
        return m_homePage;
    }
    QString startPage() const {
        return m_startPage;
#include "../shared/helpgenerator.h"

#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtGui/QGuiApplication>
#include <QtCore/QTranslator>
#include <QtCore/QLocale>
#include <QtCore/QLibraryInfo>

#include <private/qhelpprojectdata_p.h>

QT_USE_NAMESPACE

class QHG {
    Q_DECLARE_TR_FUNCTIONS(QHelpGenerator)
};

int main(int argc, char *argv[])
{
    QString error;
    QString arg;
    QString compressedFile;
    QString projectFile;
    QString basePath;
    bool showHelp = false;
    bool showVersion = false;
    bool checkLinks = false;

    // don't require a window manager even though we're a QGuiApplication
    qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
Exemple #6
0
static void initBinaryDir(
#ifndef Q_OS_WIN
        const char *argv0
#endif
        );

struct LR {
    static inline QString tr(const char *sourceText, const char *comment = 0)
    {
        return QCoreApplication::translate("LRelease", sourceText, comment);
    }
};
#else
class LR {
    Q_DECLARE_TR_FUNCTIONS(LRelease)
};
#endif

static void printOut(const QString & out)
{
    QTextStream stream(stdout);
    stream << out;
}

static void printErr(const QString & out)
{
    QTextStream stream(stderr);
    stream << out;
}
Exemple #7
0
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/

#include <QCoreApplication>
#include <QFile>
#include <QStringList>
#include <QXmlStreamReader>

#include <iostream>

class Traverse
{
    Q_DECLARE_TR_FUNCTIONS(Traverse)
};

int main(int argc, char *argv[])
{
    QCoreApplication app(argc, argv);

    if (app.arguments().count() != 2) {
        std::cerr << qPrintable(Traverse::tr("Usage: traverse <XML file>")) << std::endl;
        return 1;
    }

    QFile file(app.arguments()[1]);
    if (!file.open(QFile::ReadOnly)) {
        std::cerr << qPrintable(Traverse::tr("Failed to open file: %1").arg(app.arguments()[1])) << std::endl;
        return 1;
Exemple #8
0
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
*/

#include "KDbConnectionData.h"
#include "KDbDriverManager.h"
#include "KDbDriverMetaData.h"
#include "KDbConnection.h"

#if 0 // needed by lupdate to avoid "Qualifying with unknown namespace/class"
class KDbConnectionData { Q_DECLARE_TR_FUNCTIONS(KDbConnectionData) };
#endif

KDbConnectionData::~KDbConnectionData()
{
}

QString KDbConnectionData::toUserVisibleString(UserVisibleStringOptions options) const
{
    KDbDriverManager mananager;
    const KDbDriverMetaData *metaData = mananager.driverMetaData(d->driverId);
    if (!metaData) {
        return d->databaseName;
    } else if (metaData->isValid() && metaData->isFileBased()) {
        if (d->databaseName.isEmpty()) {
            return tr("<file>");