#include <QDesktopWidget>
#include <QToolTip>
#include <QTimer>
+#include <QPen>
#include <klocale.h>
#include <KWindowSystem>
#include <QPainter>
#include <QPixmap>
#include <QPoint>
-
+#include <QPen>
#include <QtGui/qevent.h>
#ifdef Q_WS_X11
if (d->totalRead < d->fileJob->size()) {
d->fileJob->read(READ_SIZE);
}
- else {
- logDebug() << "Entire file read, beginning file watching..." << endl;
- d->fileWatch->startScan();
-
- }
-
//logDebug() << "Data received : " << d->buffer << endl;
#include <QPainter>
#include <QClipboard>
-#include <QtGui/QPrinter>
-#include <QtGui/QPrintDialog>
+#include <QPrinter>
+#include <QPrintDialog>
+#include <QPen>
#include <kapplication.h>
#include <klocale.h>
#include <QProcess>
#include <QString>
-#include <QStringBuilder>
#include <QMap>
#include <QTextCodec>
bool found=false;
authorNameEmail=Settings::authorName();
if (!Settings::authorEmail().isEmpty())
- authorNameEmail+=(" <"%Settings::authorEmail()%'>');
- temp="Last-Translator: "%authorNameEmail%"\\n";
+ authorNameEmail+=(" <" + Settings::authorEmail() + '>');
+ temp="Last-Translator: " + authorNameEmail + "\\n";
QRegExp lt("^ *Last-Translator:.*");
for ( it = headerList.begin(),found=false; it != headerList.end() && !found; ++it )
headerList.append(temp);
QString dateTimeString = KDateTime::currentLocalDateTime().toString("%Y-%m-%d %H:%M%z");
- temp="PO-Revision-Date: "%dateTimeString%"\\n";
+ temp="PO-Revision-Date: " + dateTimeString + "\\n";
QRegExp poRevDate("^ *PO-Revision-Date:.*");
for ( it = headerList.begin(),found=false; it != headerList.end() && !found; ++it )
{
if (Q_UNLIKELY( !found ))
headerList.append(temp);
- temp="Project-Id-Version: "%CatalogProjectId%"\\n";
+ temp="Project-Id-Version: " + CatalogProjectId + "\\n";
//temp.replace( "@PACKAGE@", packageName());
QRegExp projectIdVer("^ *Project-Id-Version:.*");
for ( it = headerList.begin(),found=false; it != headerList.end() && !found; ++it )
- temp="Language-Team: "%language%" <"%mailingList%'>';
+ temp="Language-Team: " + language + " <" + mailingList + '>';
temp+="\\n";
if (Q_LIKELY( found ))
(*ait) = temp;
headerList.append(temp);
QRegExp langCodeRegExp("^ *Language: *([^ \\\\]*)");
- temp="Language: "%langCode%"\\n";
+ temp="Language: " + langCode + "\\n";
for ( it = headerList.begin(),found=false; it != headerList.end() && !found; ++it )
{
found=(langCodeRegExp.indexIn(*it)!=-1);
if (Q_UNLIKELY( !found ))
headerList.append(temp);
- temp="Content-Type: text/plain; charset="%codec->name()%"\\n";
+ temp="Content-Type: text/plain; charset=" + codec->name() + "\\n";
for ( it = headerList.begin(),found=false; it != headerList.end() && !found; ++it )
{
found=it->contains(QRegExp("^ *Content-Type:.*"));
// return;
QStringList foundAuthors;
- temp="# "%authorNameEmail%", "%QDate::currentDate().toString("yyyy")%'.';
+ temp="# " + authorNameEmail + ", " + QDate::currentDate().toString("yyyy") + '.';
// ### TODO: it would be nice if the entry could start with "COPYRIGHT" and have the "(C)" symbol (both not mandatory)
QRegExp regexpAuthorYear( "^#.*(<.+@.+>)?,\\s*([\\d]+[\\d\\-, ]*|YEAR)" );
//update years
const int index = (*ait).lastIndexOf( QRegExp("[\\d]+[\\d\\-, ]*") );
if ( index == -1 )
- (*ait)+=", "%cy;
+ (*ait)+=", " + cy;
else
- ait->insert(index+1, ", "%cy);
+ ait->insert(index+1, ", " + cy);
}
else
kDebug() << "INTERNAL ERROR: author found but iterator dangling!";
#include <QVector>
#include <QStringList>
#include <QStringMatcher>
-#include <QStringBuilder>
#include <QLinkedList>
#include <kdebug.h>
//i tried that but it failed:
if (!markup.isEmpty())
markup+='|';
- QRegExp rxSplit('('%markup%"\\W+|\\d+)+");
+ QRegExp rxSplit('(' + markup + "\\W+|\\d+)+");
main=str.split(rxSplit,QString::SkipEmptyParts);
main.prepend("\t");//little hack
if (options&Html)
{
- res.replace("{KBABELADD}","<font style=\"background-color:"%Settings::addColor().name()%";color:black\">");
+ res.replace("{KBABELADD}","<font style=\"background-color:" + Settings::addColor().name() + ";color:black\">");
res.replace("{/KBABELADD}","</font>");
- res.replace("{KBABELDEL}","<font style=\"background-color:"%Settings::delColor().name()%";color:black\">");
+ res.replace("{KBABELDEL}","<font style=\"background-color:" + Settings::delColor().name() + ";color:black\">");
res.replace("{/KBABELDEL}","</font>");
res.replace("\\n","\\n<br>");
}
#include <QtGui/qevent.h>
#include <QSortFilterProxyModel>
#include <QStyledItemDelegate>
-#include <QStringBuilder>
#include <QPainter>
#include <QTextDocument>
#include <QHeaderView>
void FileSearchModel::setReplacePreview(const QRegExp& s, const QString& r)
{
m_replaceWhat=s;
- m_replaceWith="_ST_" % r % "_END_";
+ m_replaceWith="_ST_" + r + "_END_";
emit dataChanged(index(0, Target), index(rowCount()-1, Target));
}
#include <phase.h>
#include <QLabel>
-class QaView;
#include <QStringListModel>
#include <QComboBox>
#include <QTreeView>
namespace ThreadWeaver{class Job;}
namespace ThreadWeaver{class JobCollection;}
+class QaView;
class FileSearchModel;
class SearchFileListView;
class MassReplaceView;
+
+QT_BEGIN_NAMESPACE
class Ui_FileSearchOptions;
+QT_END_NAMESPACE
/**
* Global file search/repalce tab
QStringListModel* m_model;
};
+QT_BEGIN_NAMESPACE
class Ui_MassReplaceOptions;
+QT_END_NAMESPACE
class MassReplaceView: public QDockWidget
{
if (event->type()==QEvent::ToolTip && m_mergeCatalog)
{
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
- QString text="<b>" % url().prettyUrl() % "</b>\n" % i18nc("@info:tooltip","Different entries: %1\nUnmatched entries: %2",
+ QString text="<b>" + url().prettyUrl() + "</b>\n" + i18nc("@info:tooltip","Different entries: %1\nUnmatched entries: %2",
m_mergeCatalog->differentEntries().count(),m_mergeCatalog->unmatchedCount());
text.replace('\n',"<br />");
QToolTip::showText(helpEvent->globalPos(),text);
#include <QCoreApplication>
#include <QFileSystemModel>
-#include <QStringBuilder>
#include <threadweaver/ThreadWeaver.h>
#include <kstandarddirs.h>
void DBFilesModel::openDB(const QString& name)
{
- if (QFileInfo(KStandardDirs::locateLocal("appdata", name % REMOTETM_DATABASE_EXTENSION)).exists())
+ if (QFileInfo(KStandardDirs::locateLocal("appdata", name + REMOTETM_DATABASE_EXTENSION)).exists())
openDB(name, TM::Remote);
else
openDB(name, TM::Local);
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
-#include <QStringBuilder>
-
#include <QRegExp>
#include <QMap>
return;//this string is already indexed
query1.prepare("UPDATE words "
- "SET "%field%"=? "
- "WHERE word='"%words.at(j)%'\'');
+ "SET "+field+"=? "
+ "WHERE word='"+words.at(j)+'\'');
if (!arr.isEmpty())
arr+=' ';
//BEGIN check
//TM_NOTAPPROVED=4
if (Q_UNLIKELY(!query1.exec("SELECT count(*) FROM main, target_strings WHERE "
- "main.source="%QString::number(sourceId)%" AND "
+ "main.source="+QString::number(sourceId)+" AND "
"main.target=target_strings.id AND "
"target_strings.target NOTNULL AND "
- "main.id!="%QString::number(mainId)%" AND "
+ "main.id!="+QString::number(mainId)+" AND "
"(main.bits&4)!=4")))
{
kWarning(TM_AREA) <<"select error 500: " <<query1.lastError().text();
{
// remove from record for the word (if we do not have it)
if (Q_UNLIKELY(!query1.exec("SELECT word, ids_short, ids_long FROM words WHERE "
- "word='"%words.at(j)%'\'')))
+ "word='"+words.at(j)+'\'')))
{
kWarning(TM_AREA) <<"select error 3: " <<query1.lastError().text();
return;
query1.prepare("UPDATE words "
- "SET "%field%"=? "
- "WHERE word='"%words.at(j)%'\'');
+ "SET "+field+"=? "
+ "WHERE word='"+words.at(j)+'\'');
query1.bindValue(0, arr);
//check if target in TM matches
if (Q_UNLIKELY(!query1.exec("SELECT target, target_markup, target_accel FROM target_strings WHERE "
- "id="%QString::number(targetId))))
+ "id="+QString::number(targetId))))
{
kWarning(TM_AREA)<<"select db target_strings error: " <<query1.lastError().text();
return false;
query1.prepare("UPDATE target_strings "
"SET target=?, target_accel=?, target_markup=? "
- "WHERE id="%QString::number(targetId));
+ "WHERE id="+QString::number(targetId));
query1.bindValue(0, target.string.isEmpty()?QVariant():target.string);
query1.bindValue(1, targetAccelPos!=-1?QVariant(targetAccelPos):QVariant());
if (!ok)
kWarning(TM_AREA)<<"target update failed"<<query1.lastError().text();
else
- ok=query1.exec("UPDATE main SET change_date=CURRENT_DATE WHERE target="%QString::number(targetId));
+ ok=query1.exec("UPDATE main SET change_date=CURRENT_DATE WHERE target="+QString::number(targetId));
return ok;
}
//else -> there will be new record insertion and main table update below
//kWarning(TM_AREA) <<"YES! UPDATING!";
query1.prepare("UPDATE main "
"SET target=?, bits=?, change_date=CURRENT_DATE "
- "WHERE id="%QString::number(mainId));
+ "WHERE id="+QString::number(mainId));
query1.bindValue(0, targetId);
query1.bindValue(1, bits);
if (m_type==TM::Local)
{
QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE",m_dbName);
- db.setDatabaseName(KStandardDirs::locateLocal("appdata", m_dbName % TM_DATABASE_EXTENSION));
+ db.setDatabaseName(KStandardDirs::locateLocal("appdata", m_dbName + TM_DATABASE_EXTENSION));
m_connectionSuccessful=db.open();
if (Q_UNLIKELY( !m_connectionSuccessful ))
{
if (!m_connParams.isFilled())
{
- QFile rdb(KStandardDirs::locateLocal("appdata", m_dbName % REMOTETM_DATABASE_EXTENSION));
+ QFile rdb(KStandardDirs::locateLocal("appdata", m_dbName + REMOTETM_DATABASE_EXTENSION));
if (!rdb.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QString tmp=c.markup;
if (!c.markup.isEmpty())
tmp+='|';
- QRegExp rxSplit('('%tmp%"\\W+|\\d+)+");
+ QRegExp rxSplit('('+tmp+"\\W+|\\d+)+");
QString sourceClean(m_source.string);
sourceClean.remove(c.accel);
//get records containing current word
QSqlQuery queryFetch("SELECT id, source, source_accel, source_markup FROM source_strings WHERE "
- "source_strings.id IN ("%joined%')',db);
+ "source_strings.id IN ("+joined+')',db);
TMEntry e;
while (queryFetch.next())
{
QSqlQuery queryRest("SELECT main.id, main.date, main.ctxt, main.bits, "
"target_strings.target, target_strings.target_accel, target_strings.target_markup, "
- "files.path, main.change_date " % change_author_str %
- "FROM main JOIN target_strings ON (target_strings.id=main.target) JOIN files ON (files.id=main.file) " % authors_table_str % "WHERE "
- "main.source="%QString::number(e.id)%" AND "
+ "files.path, main.change_date " + change_author_str +
+ "FROM main JOIN target_strings ON (target_strings.id=main.target) JOIN files ON (files.id=main.file) " + authors_table_str + "WHERE "
+ "main.source="+QString::number(e.id)+" AND "
"(main.bits&4)!=4 AND "
"target_strings.target NOTNULL"
,db); //ORDER BY tm_main.id ?
qlonglong fileId=getFileId(m_filePath,db);
if (m_form!=-1)
- m_ctxt+=TM_DELIMITER%QString::number(m_form);
+ m_ctxt+=TM_DELIMITER+QString::number(m_form);
QSqlQuery queryBegin("BEGIN",db);
qlonglong priorId=-1;
#include <QTimer>
#include <QSortFilterProxyModel>
-#include <QStringBuilder>
#include <kfiledialog.h>
#include <kdebug.h>
// #include <kstandarddirs.h>
if (connectionBox->isVisible())
{
- QFile rdb(KStandardDirs::locateLocal("appdata", name->text() % REMOTETM_DATABASE_EXTENSION));
+ QFile rdb(KStandardDirs::locateLocal("appdata", name->text() + REMOTETM_DATABASE_EXTENSION));
if (!rdb.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
return;
#include <QtGui/qevent.h>
#include <QSortFilterProxyModel>
#include <QStyledItemDelegate>
-#include <QStringBuilder>
#include <QTextDocument>
#include <QTextCodec>
#include <QStringListModel>
escapedSource.replace('%',"\b%");escapedSource.replace('_',"\b_");
escapedTarget.replace('%',"\b%");escapedTarget.replace('_',"\b_");
if (!escapedSource.isEmpty())
- sourceQuery="AND source_strings.source "%invertSourceStr%"LIKE '%"+escapedSource+"%' ESCAPE '\b' ";
+ sourceQuery="AND source_strings.source " + invertSourceStr + "LIKE '%" + escapedSource + "%' ESCAPE '\b' ";
if (!escapedTarget.isEmpty())
- targetQuery="AND target_strings.target "%invertTargetStr%"LIKE '%"+escapedTarget+"%' ESCAPE '\b' ";
+ targetQuery="AND target_strings.target " + invertTargetStr + "LIKE '%" + escapedTarget + "%' ESCAPE '\b' ";
}
else if (m_queryType==WordOrder)
{
else
{
if (!escapedSource.isEmpty())
- sourceQuery="AND source_strings.source "%invertSourceStr%"GLOB '"%escapedSource%"' ";
+ sourceQuery="AND source_strings.source " + invertSourceStr + "GLOB '" + escapedSource + "' ";
if (!escapedTarget.isEmpty())
- targetQuery="AND target_strings.target "%invertTargetStr%"GLOB '"%escapedTarget%"' ";
+ targetQuery="AND target_strings.target " + invertTargetStr + "GLOB '" + escapedTarget + "' ";
}
if (!filemask.isEmpty())
- fileQuery="AND files.path GLOB '"%escapedFilemask%"' ";
+ fileQuery="AND files.path GLOB '" + escapedFilemask + "' ";
QString fromPart="FROM main JOIN source_strings ON (source_strings.id=main.source) "
"JOIN target_strings ON (target_strings.id=main.target), files "
{
int pos=re.indexIn(string);
if (pos!=-1)
- return string.replace(pos, re.matchedLength(), "<b>" % re.cap(0) % "</b>");
+ return string.replace(pos, re.matchedLength(), "<b>" + re.cap(0) + "</b>");
}
//StartLen sl=m_highlightDataForSourceRow.value(source_row).at(index.column());
#include <QSqlQueryModel>
#include <QSqlDatabase>
-
-class QaView;
-class Ui_QueryOptions;
-class KLineEdit;
#include <QComboBox>
#include <QTreeView>
#include <QSortFilterProxyModel>
#include <QCheckBox>
-
namespace ThreadWeaver{class Job;}
+class QaView;
+class KLineEdit;
class TMResultsSortFilterProxyModel;
+QT_BEGIN_NAMESPACE
+class Ui_QueryOptions;
+QT_END_NAMESPACE
+
namespace TM {
class TMDBModel;
//result.replace("&","&");
//result.replace("<","<");
//result.replace(">",">");
- result.replace("{KBABELADD}","<font style=\"background-color:"%Settings::addColor().name()%";color:black\">");
+ result.replace("{KBABELADD}","<font style=\"background-color:"+Settings::addColor().name()+";color:black\">");
result.replace("{/KBABELADD}","</font>");
- result.replace("{KBABELDEL}","<font style=\"background-color:"%Settings::delColor().name()%";color:black\">");
+ result.replace("{KBABELDEL}","<font style=\"background-color:"+Settings::delColor().name()+";color:black\">");
result.replace("{/KBABELDEL}","</font>");
result.replace("\\n","\\n<br>");
result.replace("\\n","\\n<br>");
//QString english=entry.english;
- QRegExp rxAdd("<font style=\"background-color:[^>]*" % Settings::addColor().name() % "[^>]*\">([^>]*)</font>");
- QRegExp rxDel("<font style=\"background-color:[^>]*" % Settings::delColor().name() % "[^>]*\">([^>]*)</font>");
+ QRegExp rxAdd("<font style=\"background-color:[^>]*" + Settings::addColor().name() + "[^>]*\">([^>]*)</font>");
+ QRegExp rxDel("<font style=\"background-color:[^>]*" + Settings::delColor().name() + "[^>]*\">([^>]*)</font>");
//rxAdd.setMinimal(true);
//rxDel.setMinimal(true);
//first things first
int pos=0;
while ((pos=rxDel.indexIn(diff,pos))!=-1)
- diff.replace(pos,rxDel.matchedLength(),"\tKBABELDEL\t" % rxDel.cap(1) % "\t/KBABELDEL\t");
+ diff.replace(pos,rxDel.matchedLength(),"\tKBABELDEL\t" + rxDel.cap(1) + "\t/KBABELDEL\t");
pos=0;
while ((pos=rxAdd.indexIn(diff,pos))!=-1)
- diff.replace(pos,rxAdd.matchedLength(),"\tKBABELADD\t" % rxAdd.cap(1) % "\t/KBABELADD\t");
+ diff.replace(pos,rxAdd.matchedLength(),"\tKBABELADD\t" + rxAdd.cap(1) + "\t/KBABELADD\t");
diff.replace("<","<");
diff.replace(">",">");
//BEGIN BEGIN HANDLING
QRegExp rxNonTranslatable;
if (tryMarkup)
- rxNonTranslatable.setPattern("^((" % entry.markupExpr % ")|(\\W|\\d)+)+");
+ rxNonTranslatable.setPattern("^((" + entry.markupExpr + ")|(\\W|\\d)+)+");
else
rxNonTranslatable.setPattern("^(\\W|\\d)+");
//END BEGIN HANDLING
//BEGIN END HANDLING
if (tryMarkup)
- rxNonTranslatable.setPattern("(("% entry.markupExpr %")|(\\W|\\d)+)+$");
+ rxNonTranslatable.setPattern("((" + entry.markupExpr + ")|(\\W|\\d)+)+$");
else
rxNonTranslatable.setPattern("(\\W|\\d)+$");
PageAddPrinter::PageAddPrinter(QWidget *parent) :
GenericPage(parent),
- ui(new Ui::PageAddPrinter)
+ ui(new Ui_PageAddPrinter)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
#include "GenericPage.h"
-namespace Ui {
- class PageAddPrinter;
-}
+QT_BEGIN_NAMESPACE
+class Ui_PageAddPrinter;
+QT_END_NAMESPACE
class PageAddPrinter : public GenericPage
{
void on_nameLE_textChanged(const QString &text);
private:
- Ui::PageAddPrinter *ui;
+ Ui_PageAddPrinter *ui;
};
#endif
PageChoosePrinters::PageChoosePrinters(const QVariantHash &args, QWidget *parent) :
GenericPage(parent),
- ui(new Ui::PageChoosePrinters)
+ ui(new Ui_PageChoosePrinters)
{
ui->setupUi(this);
#include "GenericPage.h"
-namespace Ui {
- class PageChoosePrinters;
-}
+QT_BEGIN_NAMESPACE
+class Ui_PageChoosePrinters;
+QT_END_NAMESPACE
class PageChoosePrinters : public GenericPage
{
bool canProceed() const;
private:
- Ui::PageChoosePrinters *ui;
+ Ui_PageChoosePrinters *ui;
};
#endif
#include <KLocale>
#include <KMessageBox>
-#include <QStringBuilder>
-
JobModel::JobModel(QObject *parent) :
QStandardItemModel(parent),
m_jobRequest(0),
QString pages = QString::number(job.pages());
if (job.processedPages()) {
- pages = QString::number(job.processedPages()) % QLatin1Char('/') % QString::number(job.processedPages());
+ pages = QString::number(job.processedPages()) + QLatin1Char('/') + QString::number(job.processedPages());
}
if (statusItem->data(RoleJobPages) != pages) {
statusItem->setData(pages, RoleJobPages);
QString pages = QString::number(job.pages());
if (job.processedPages()) {
- pages = QString::number(job.processedPages()) % QLatin1Char('/') % QString::number(job.processedPages());
+ pages = QString::number(job.processedPages()) + QLatin1Char('/') + QString::number(job.processedPages());
}
if (item(pos, ColStatus)->data(RoleJobPages) != pages) {
item(pos, ColStatus)->setData(pages, RoleJobPages);
#include <config.h>
#include <QCoreApplication>
-#include <QStringBuilder>
#include <QDBusConnection>
#include <QByteArray>
class KDE_EXPORT KCupsPrinter
{
Q_GADGET
- Q_ENUMS(Attribute)
+ Q_ENUMS(Status)
public:
typedef enum {
Idle = 3,
typedef QList<KCupsPrinter> KCupsPrinters;
Q_DECLARE_METATYPE(KCupsPrinters)
Q_DECLARE_METATYPE(KCupsPrinter)
+Q_DECLARE_METATYPE(KCupsPrinter::Status)
#endif // KCUPSPRINTER_H
***************************************************************************/
#include "KCupsRequest.h"
-
#include "KIppRequest.h"
#include "KCupsJob.h"
#include "KCupsPrinter.h"
-
#include <KLocale>
#include <KDebug>
-#include <QStringBuilder>
#include <cups/adminutil.h>
#include <cups/ppd.h>
if (datadir.isEmpty()) {
datadir = CUPS_DATADIR;
}
- filename = datadir % QLatin1String("/data/testprint");
+ filename = datadir + QLatin1String("/data/testprint");
/*
* Point to the printer/class...
*/
if (isClass) {
- resource = QLatin1String("/classes/") % printerName;
+ resource = QLatin1String("/classes/") + printerName;
} else {
- resource = QLatin1String("/printers/") % printerName;
+ resource = QLatin1String("/printers/") + printerName;
}
KIppRequest request(IPP_PRINT_JOB, resource.toUtf8(), filename);
#include "KIppRequest.h"
#include "KIppRequest_p.h"
-#include <QStringBuilder>
-
#include <KDebug>
KIppRequest::KIppRequest() :
QString destination;
if (isClass) {
- destination = QLatin1String("/classes/") % name;
+ destination = QLatin1String("/classes/") + name;
} else {
- destination = QLatin1String("/printers/") % name;
+ destination = QLatin1String("/printers/") + name;
}
httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", cupsUser(), "localhost",
#include "PPDModel.h"
-#include <QStringBuilder>
-
#include <KLocale>
-
#include <KDebug>
PPDModel::PPDModel(QObject *parent) :
QString text;
if (recommended) {
- text = makeAndModel %
- QLatin1String(" (") %
- naturalLanguage %
+ text = makeAndModel +
+ QLatin1String(" (") +
+ naturalLanguage +
QLatin1Char(')');
} else {
// Removes the Make part of the string
}
// Create the PPD
- text = makeAndModel.trimmed() %
- QLatin1String(" (") %
- naturalLanguage %
+ text = makeAndModel.trimmed() +
+ QLatin1String(" (") +
+ naturalLanguage +
QLatin1Char(')');
}
ret->setText(text);
// store the printer state
KCupsPrinter::Status state = printer.state();
- if (state != destItem->data(DestState)) {
+ if (state != qvariant_cast<KCupsPrinter::Status>(destItem->data(DestState))) {
destItem->setData(state, DestState);
}
kDebug() << state << printer.name();
// store if the printer is accepting jobs
bool accepting = printer.isAcceptingJobs();
- if (accepting != destItem->data(DestIsAcceptingJobs)) {
+ if (accepting != destItem->data(DestIsAcceptingJobs).toBool()) {
destItem->setData(accepting, DestIsAcceptingJobs);
}
// store the printer status message
QString status = destStatus(state, printer.stateMsg(), accepting);
- if (status != destItem->data(DestStatus)) {
+ if (status != destItem->data(DestStatus).toString()) {
destItem->setData(status, DestStatus);
}
bool paused = (state == KCupsPrinter::Stopped || !accepting);
- if (paused != destItem->data(DestIsPaused)) {
+ if (paused != destItem->data(DestIsPaused).toBool()) {
destItem->setData(paused, DestIsPaused);
}
// store if the printer is shared
bool shared = printer.isShared();
- if (shared != destItem->data(DestIsShared)) {
+ if (shared != destItem->data(DestIsShared).toBool()) {
destItem->setData(shared, DestIsShared);
}
// store if the printer is a class
// the printer-type param is a flag
bool isClass = printer.isClass();
- if (isClass != destItem->data(DestIsClass)) {
+ if (isClass != destItem->data(DestIsClass).toBool()) {
destItem->setData(isClass, DestIsClass);
}
// store if the printer type
// the printer-type param is a flag
uint printerType = printer.type();
- if (printerType != destItem->data(DestType)) {
+ if (printerType != destItem->data(DestType).toUInt()) {
destItem->setData(printerType, DestType);
destItem->setData(printerType & CUPS_PRINTER_REMOTE, DestRemote);
}
// store the printer kind
QString kind = printer.makeAndModel();
- if (kind != destItem->data(DestKind)) {
+ if (kind != destItem->data(DestKind).toString()) {
destItem->setData(kind, DestKind);
}
// store the printer commands
QStringList commands = printer.commands();
- if (commands != destItem->data(DestCommands)) {
+ if (commands != destItem->data(DestCommands).toStringList()) {
destItem->setData(commands, DestCommands);
}
#include <QStandardItemModel>
#include <QLineEdit>
#include <QtGui/qitemselectionmodel.h>
-#include <QStringBuilder>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusConnection>
SelectMakeModel::SelectMakeModel(QWidget *parent) :
QWidget(parent),
- ui(new Ui::SelectMakeModel),
+ ui(new Ui_SelectMakeModel),
m_ppdRequest(0),
m_gotBestDrivers(false),
m_hasRecommended(false)
#include "KCupsConnection.h"
#include "PPDModel.h"
-namespace Ui {
- class SelectMakeModel;
-}
+QT_BEGIN_NAMESPACE
+class Ui_SelectMakeModel;
+QT_END_NAMESPACE
class KCupsRequest;
class KDE_EXPORT SelectMakeModel : public QWidget
void selectMakeModelPPD();
void selectRecommendedPPD();
- Ui::SelectMakeModel *ui;
+ Ui_SelectMakeModel *ui;
PPDModel *m_sourceModel;
KCupsRequest *m_ppdRequest;
ReturnArguments m_ppds;
PrintKCM::PrintKCM(QWidget *parent, const QVariantList &args) :
KCModule(PrintKCMFactory::componentData(), parent, args),
- ui(new Ui::PrintKCM),
+ ui(new Ui_PrintKCM),
m_lastError(-1), // Force the error to run on the first time
m_serverRequest(0)
{
#include <KCupsServer.h>
-namespace Ui {
- class PrintKCM;
-}
class KCupsRequest;
class PrinterModel;
+
+QT_BEGIN_NAMESPACE
+class Ui_PrintKCM;
+QT_END_NAMESPACE
+
class PrintKCM : public KCModule
{
Q_OBJECT
void systemPreferencesTriggered();
private:
- Ui::PrintKCM *ui;
+ Ui_PrintKCM *ui;
PrinterModel *m_model;
int m_lastError;
PrinterDescription::PrinterDescription(QWidget *parent) :
QWidget(parent),
- ui(new Ui::PrinterDescription),
+ ui(new Ui_PrinterDescription),
m_isClass(false),
m_markerChangeTime(0)
{
#include <QToolButton>
#include <QSortFilterProxyModel>
-namespace Ui {
- class PrinterDescription;
-}
class PrintQueueModel;
+
+QT_BEGIN_NAMESPACE
+class Ui_PrinterDescription;
+QT_END_NAMESPACE
+
class PrinterDescription : public QWidget
{
Q_OBJECT
void requestFinished();
private:
- Ui::PrinterDescription *ui;
+ Ui_PrinterDescription *ui;
QString m_destName;
bool m_isClass;
bool m_isShared;
#include <QToolBar>
#include <QMenu>
#include <QByteArray>
-#include <QStringBuilder>
-
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusMessage>
PrintQueueUi::PrintQueueUi(const KCupsPrinter &printer, QWidget *parent) :
KDialog(parent),
- ui(new Ui::PrintQueueUi),
+ ui(new Ui_PrintQueueUi),
m_destName(printer.name()),
m_preparingMenu(false),
m_printerPaused(false),
if (printer.info().isEmpty()) {
m_title = printer.name();
} else {
- m_title = printer.name() % QLatin1String(" - ") % printer.info();
+ m_title = printer.name() + QLatin1String(" - ") + printer.info();
}
setWindowTitle(m_title);
setButtons(0);
if (printer.info().isEmpty()) {
m_title = printer.name();
} else {
- m_title = printer.name() % QLatin1String(" - ") % printer.info();
+ m_title = printer.name() + QLatin1String(" - ") + printer.info();
}
// get printer-state
#include <QtCore/qabstractitemmodel.h>
#include <QToolButton>
-namespace Ui {
- class PrintQueueUi;
-}
-
class KCupsPrinter;
class JobSortFilterModel;
class JobModel;
+
+QT_BEGIN_NAMESPACE
+class Ui_PrintQueueUi;
+QT_END_NAMESPACE
+
class PrintQueueUi : public KDialog
{
Q_OBJECT
void setState(int state, const QString &message);
void modifyJob(int action, const QString &destName = QString());
- Ui::PrintQueueUi *ui;
+ Ui_PrintQueueUi *ui;
QToolButton *m_filterJobs;
JobSortFilterModel *m_proxyModel;
JobModel *m_model;
if (m_eventType != eventRect.eventType())
return false;
- return ::operator==(*this, eventRect);
+ return QT_PREPEND_NAMESPACE(operator==(*this, eventRect));
}
bool EventRect::operator<(const EventRect& eventRect) const