{
/// returns the next store available for scanning
- kDebug() << "propagate: " << url << endl;
+ kDebug() << "propagate: " << url;
if (parent) {
parent->folder->append(folder);
void
RemoteLister::completed()
{
- kDebug() << "completed: " << url().prettyUrl() << endl;
+ kDebug() << "completed: " << url().prettyUrl();
// Delay the call to _completed since it can do a "delete this"
QTimer::singleShot(0, this, SLOT(_completed()));
void
RemoteLister::canceled()
{
- kDebug() << "canceled: " << url().prettyUrl() << endl;
+ kDebug() << "canceled: " << url().prettyUrl();
QTimer::singleShot(0, this, SLOT(_completed()));
}
currentStore->stores.erase(first);
//this returns _immediately_
- kDebug() << "scanning: " << url << endl;
+ kDebug() << "scanning: " << url;
openUrl(url);
}
else {
ScanManager::~ScanManager()
{
if (m_thread) {
- kDebug() << "Attempting to abort scan operation..." << endl;
+ kDebug() << "Attempting to abort scan operation...";
m_abort = true;
m_thread->wait();
}
//url is guaranteed clean and safe
- kDebug() << "Scan requested for: " << url.prettyUrl() << endl;
+ kDebug() << "Scan requested for: " << url.prettyUrl();
if (running()) {
kWarning() << "Tried to launch two concurrent scans, aborting old one...";
{
//find a pointer to the requested branch
- kDebug() << "Cache-(a)hit: " << cachePath << endl;
+ kDebug() << "Cache-(a)hit: " << cachePath;
QStringList split = path.mid(cachePath.length()).split(QLatin1Char( '/' ));
Folder *d = *it;
delete trees;
//we found a completed tree, thus no need to scan
- kDebug() << "Found cache-handle, generating map.." << endl;
+ kDebug() << "Found cache-handle, generating map..";
emit branchCacheHit(d);
}
else if (cachePath.startsWith(path)) //then part of the requested tree is already scanned
{
- kDebug() << "Cache-(b)hit: " << cachePath << endl;
+ kDebug() << "Cache-(b)hit: " << cachePath;
it.transferTo(*trees);
}
}
}
bool CrontabPrinter::start() {
- logDebug() << "Printing selection..." << endl;
+ logDebug() << "Printing selection...";
if (d->printer == NULL) {
d->printer = new QPrinter();
// initialize the printer using the print dialog
QPrintDialog *printDialog = KdePrint::createPrintDialog(d->printer, d->crontabWidget);
if (printDialog->exec() == QDialog::Rejected) {
- logDebug() << "Printing canceled" << endl;
+ logDebug() << "Printing canceled";
delete printDialog;
return false;
}
}
void CrontabPrinter::printPageNumber() {
- logDebug() << "Printing page number..." << endl;
+ logDebug() << "Printing page number...";
d->painter->translate(0, - d->currentRowPosition);
d->printView->moveTo(QPoint(0, d->printView->height()) );
int columnWidthSum = 0;
foreach(int width, columnWidths) {
- logDebug() << "Column : " << width << endl;
+ logDebug() << "Column : " << width;
columnWidthSum += width;
}
if (columnWidthSum >= pageWidth) {
- logDebug() << "The printing could be out of the page" << endl;
+ logDebug() << "The printing could be out of the page";
return columnWidths;
}
initialize();
- logDebug() << "Clipboard Status " << hasClipboardContent() << endl;
+ logDebug() << "Clipboard Status " << hasClipboardContent();
d->tasksWidget->setFocus();
QTreeWidgetItem* item = d->tasksWidget->treeWidget()->topLevelItem(0);
if (item != NULL) {
- logDebug() << "First item found" << d->tasksWidget->treeWidget()->topLevelItemCount() << endl;
+ logDebug() << "First item found" << d->tasksWidget->treeWidget()->topLevelItemCount();
item->setSelected(true);
}
void CrontabWidget::initialize() {
QVBoxLayout* layout = new QVBoxLayout(this);
- logDebug() << "Begin view refresh" << endl;
+ logDebug() << "Begin view refresh";
- logDebug() << "Creating Tasks list..." << endl;
+ logDebug() << "Creating Tasks list...";
QHBoxLayout* cronSelector = createCronSelector();
layout->addLayout(cronSelector);
d->variablesWidget->refreshVariables(ctCron);
if (ctCron->isMultiUserCron() && ctHost()->isRootUser()==false) {
- logDebug() << "Disabling view..." << endl;
+ logDebug() << "Disabling view...";
d->tasksWidget->treeWidget()->setEnabled(false);
d->variablesWidget->treeWidget()->setEnabled(false);
d->tasksWidget->toggleRunNowAction(false);
}
else {
- logDebug() << "Enabling view..." << endl;
+ logDebug() << "Enabling view...";
d->tasksWidget->treeWidget()->setEnabled(true);
d->variablesWidget->treeWidget()->setEnabled(true);
QString clipboardText;
if (d->tasksWidget->treeWidget()->hasFocus()) {
- logDebug() << "Tasks copying" << endl;
+ logDebug() << "Tasks copying";
QList<TaskWidget*> tasksWidget = d->tasksWidget->selectedTasksWidget();
foreach(TaskWidget* taskWidget, tasksWidget) {
}
if (d->variablesWidget->treeWidget()->hasFocus()) {
- logDebug() << "Variables copying" << endl;
+ logDebug() << "Variables copying";
QList<VariableWidget*> variablesWidget = d->variablesWidget->selectedVariablesWidget();
foreach(VariableWidget* variableWidget, variablesWidget) {
QApplication::clipboard()->setText(clipboardText, QClipboard::Clipboard);
QApplication::clipboard()->setText(clipboardText, QClipboard::Selection);
- logDebug() << "Clipboard Status " << hasClipboardContent() << endl;
+ logDebug() << "Clipboard Status " << hasClipboardContent();
togglePasteAction(hasClipboardContent());
}
void CrontabWidget::cut() {
- logDebug() << "Cut content" << endl;
+ logDebug() << "Cut content";
copy();
if (d->tasksWidget->treeWidget()->hasFocus()) {
- logDebug() << "Tasks cutting" << endl;
+ logDebug() << "Tasks cutting";
d->tasksWidget->deleteSelection();
}
if (d->variablesWidget->treeWidget()->hasFocus()) {
- logDebug() << "Variables cutting" << endl;
+ logDebug() << "Variables cutting";
d->variablesWidget->deleteSelection();
}
}
void CrontabWidget::paste() {
- logDebug() << "Paste content" << endl;
+ logDebug() << "Paste content";
if (d->tasksWidget->treeWidget()->hasFocus()) {
foreach(CTTask* task, d->clipboardTasks) {
return d->ctHost->findSystemCron();
if (d->otherUsers->currentIndex() == d->otherUsers->count()-1) {
- logDebug() << "Using Global Cron" << endl;
+ logDebug() << "Using Global Cron";
return d->ctGlobalCron;
}
}
void CrontabWidget::setupActions() {
- logDebug() << "Setup actions" << endl;
+ logDebug() << "Setup actions";
//Edit menu
d->cutAction = KStandardAction::cut(this, SLOT(cut()), this);
d->pasteAction = KStandardAction::paste(this, SLOT(paste()), this);
togglePasteAction(false);
- logDebug() << "Actions initialized" << endl;
+ logDebug() << "Actions initialized";
}
CrontabPrinter printer(this);
if (printer.start() == false) {
- logDebug() << "Unable to start printer" << endl;
+ logDebug() << "Unable to start printer";
return;
}
printer.printTasks();
CTGlobalCron::CTGlobalCron(CTHost* _ctHost) :
CTCron() {
- logDebug() << "Initializing CTGlobalCron" << endl;
+ logDebug() << "Initializing CTGlobalCron";
d->multiUserCron = true;
d->systemCron = false;
}
QList<CTTask*> CTGlobalCron::tasks() const {
- logDebug() << "Global Cron Tasks" << endl;
+ logDebug() << "Global Cron Tasks";
QList<CTTask*> tasks;
foreach(CTCron* cron, ctHost->crons) {
}
QList<CTVariable*> CTGlobalCron::variables() const {
- logDebug() << "Global Cron Variables" << endl;
+ logDebug() << "Global Cron Variables";
QList<CTVariable*> variables;
foreach(CTCron* cron, ctHost->crons) {
}
void CTGlobalCron::addTask(CTTask* task) {
- logDebug() << "Global Cron addTask" << endl;
+ logDebug() << "Global Cron addTask";
CTCron* actualCron = ctHost->findUserCron(task->userLogin);
actualCron->addTask(task);
}
void CTGlobalCron::addVariable(CTVariable* variable) {
- logDebug() << "Global Cron addVariable" << endl;
+ logDebug() << "Global Cron addVariable";
CTCron* actualCron = ctHost->findUserCron(variable->userLogin);
actualCron->addVariable(variable);
void CTGlobalCron::modifyTask(CTTask* task) {
- logDebug() << "Global Cron modifyTask" << endl;
+ logDebug() << "Global Cron modifyTask";
CTCron* actualCron = ctHost->findCronContaining(task);
}
void CTGlobalCron::modifyVariable(CTVariable* variable) {
- logDebug() << "Global Cron modifyVariable" << endl;
+ logDebug() << "Global Cron modifyVariable";
CTCron* actualCron = ctHost->findCronContaining(variable);
}
void CTGlobalCron::removeTask(CTTask* task) {
- logDebug() << "Global Cron removeTask" << endl;
+ logDebug() << "Global Cron removeTask";
CTCron* actualCron = ctHost->findCronContaining(task);
actualCron->removeTask(task);
}
void CTGlobalCron::removeVariable(CTVariable* variable) {
- logDebug() << "Global Cron removeVariable" << endl;
+ logDebug() << "Global Cron removeVariable";
CTCron* actualCron = ctHost->findCronContaining(variable);
actualCron->removeVariable(variable);
if (initializeFromUserInfos(userInfos) == false) {
ctInitializationError.setErrorMessage(i18n("No password entry found for uid '%1'", getuid()));
- logDebug() << "Error in crontab creation of" << userInfos->pw_name << endl;
+ logDebug() << "Error in crontab creation of" << userInfos->pw_name;
return;
}
this->parseFile(d->tmpFileName);
}
else {
- logDebug() << "Error when executing command" << commandLineStatus.commandLine << endl;
- logDebug() << "Standard output :" << commandLineStatus.standardOutput << endl;
- logDebug() << "Standard error :" << commandLineStatus.standardError << endl;
+ logDebug() << "Error when executing command" << commandLineStatus.commandLine;
+ logDebug() << "Standard output :" << commandLineStatus.standardOutput;
+ logDebug() << "Standard error :" << commandLineStatus.standardError;
}
d->initialTaskCount = d->task.size();
return *this;
if (source.isSystemCron() == true) {
- logDebug() << "Affect the system cron" << endl;
+ logDebug() << "Affect the system cron";
}
d->variable.clear();
return false;
}
- //logDebug() << exportCron() << endl;
+ //logDebug() << exportCron();
QTextStream out(&file);
out << exportCron();
task->setSystemCrontab(false);
}
- logDebug() << "Adding task" << task->comment << " user : "<< task->userLogin << endl;
+ logDebug() << "Adding task" << task->comment << " user : "<< task->userLogin;
d->task.append(task);
}
variable->userLogin = d->userLogin;
- logDebug() << "Adding variable" << variable->variable << " user : "<< variable->userLogin << endl;
+ logDebug() << "Adding variable" << variable->variable << " user : "<< variable->userLogin;
d->variable.append(variable);
}
CTSaveStatus CTHost::save() {
if (isRootUser() == false) {
- logDebug() << "Save current user cron" << endl;
+ logDebug() << "Save current user cron";
CTCron* ctCron = findCurrentUserCron();
return ctCron->save();
return ctCron;
}
- logDebug() << "Unable to find the current user Cron. Please report this bug and your crontab config to the developers" << endl;
+ logDebug() << "Unable to find the current user Cron. Please report this bug and your crontab config to the developers";
return NULL;
}
return ctCron;
}
- logDebug() << "Unable to find the system Cron. Please report this bug and your crontab config to the developers" << endl;
+ logDebug() << "Unable to find the system Cron. Please report this bug and your crontab config to the developers";
return NULL;
}
return ctCron;
}
- logDebug() << "Unable to find the user Cron " << userLogin << ". Please report this bug and your crontab config to the developers" << endl;
+ logDebug() << "Unable to find the user Cron " << userLogin << ". Please report this bug and your crontab config to the developers";
return NULL;
}
}
}
- logDebug() << "Unable to find the cron of this task. Please report this bug and your crontab config to the developers" << endl;
+ logDebug() << "Unable to find the cron of this task. Please report this bug and your crontab config to the developers";
return NULL;
}
}
}
- logDebug() << "Unable to find the cron of this variable. Please report this bug and your crontab config to the developers" << endl;
+ logDebug() << "Unable to find the cron of this variable. Please report this bug and your crontab config to the developers";
return NULL;
}
// If reboot bypass initialize functions so no keys selected in modify task
if (reboot == false) {
- //logDebug() << "Line : " << tokStr << endl;
+ //logDebug() << "Line : " << tokStr;
minute.initialize(tokStr.mid(0, spacePos));
while (isSpace(tokStr, spacePos+1))
KUrl commandPath(completeCommandPath());
KMimeType::Ptr mimeType = KMimeType::findByUrl(commandPath);
- //logDebug() << mimeType->name() << endl;
+ //logDebug() << mimeType->name();
if (mimeType->name() == QLatin1String( "application/x-executable" ) || mimeType->name() == QLatin1String( "application/octet-stream" )) {
//The next line is identical as SmallIcon(commandPath.fileName()), but is able to return a isNull() QPixmap
mainLayout->addLayout(treeLayout);
- logDebug() << "Generic list created" << endl;
+ logDebug() << "Generic list created";
connect(treeWidget(), SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(modifySelection(QTreeWidgetItem*,int)));
}
d->crontabWidget = new CrontabWidget(this, d->ctHost);
- logDebug() << "Crontab Widget initialized" << endl;
+ logDebug() << "Crontab Widget initialized";
connect(d->crontabWidget->tasksWidget(), SIGNAL(taskModified(bool)), this, SIGNAL(changed(bool)));
connect(d->crontabWidget->variablesWidget(), SIGNAL(variableModified(bool)), this, SIGNAL(changed(bool)));
}
void KCMCron::load() {
- logDebug() << "Calling load" << endl;
+ logDebug() << "Calling load";
d->ctHost->cancel();
}
void KCMCron::save() {
- logDebug() << "Saving crontab..." << endl;
+ logDebug() << "Saving crontab...";
CTSaveStatus saveStatus = d->ctHost->save();
if (saveStatus.isError() == true) {
}
void KCMCron::defaults() {
- logDebug() << "Loading defaults" << endl;
+ logDebug() << "Loading defaults";
d->ctHost->cancel();
}
void TaskEditorDialog::emptyMinutesGroup() {
- logDebug() << "Empty minutes layout" << endl;
+ logDebug() << "Empty minutes layout";
for (int minuteIndex = 0; minuteIndex<=minuteTotal; ++minuteIndex ) {
minutesLayout->removeWidget(minuteButtons[minuteIndex]);
minuteButtons[minuteIndex]->hide();
- logDebug() << "Layout count" << minutesLayout->count() << endl;
+ logDebug() << "Layout count" << minutesLayout->count();
}
minutesLayout->removeItem(minutesPreselectionLayout);
*/
emptyMinutesGroup();
- logDebug() << "Show all minutes" << endl;
+ logDebug() << "Show all minutes";
int minuteIndex = 0;
for (int row = 0; row < (minuteTotal+1)/minutePerColumn; ++row) {
}
void TaskEditorDialog::reduceMinutesGroup() {
- logDebug() << "Reducing view" << endl;
+ logDebug() << "Reducing view";
emptyMinutesGroup();
}
}
else {
- logDebug() << "Reducing id" << minuteIndex << endl;
+ logDebug() << "Reducing id" << minuteIndex;
ctTask->minute.setEnabled(minuteIndex, false);
minuteButtons[minuteIndex]->setChecked(false);
}
void TaskEditorDialog::createMinutesGroup(QWidget* main) {
- logDebug() << "Creating minutes group" << endl;
+ logDebug() << "Creating minutes group";
minutesGroup = new QGroupBox( i18n("Minutes"), main);
reduceMinutesGroup();
}
- logDebug() << "Minutes group created" << endl;
+ logDebug() << "Minutes group created";
}
NumberPushButton* TaskEditorDialog::createHourButton(QGroupBox* hoursGroup, int hour) {
QGroupBox* TaskEditorDialog::createHoursGroup(QWidget* main) {
- logDebug() << "Creating hours group" << endl;
+ logDebug() << "Creating hours group";
QGroupBox* hoursGroup = new QGroupBox(i18n("Hours"), main);
QGridLayout* hoursLayout = new QGridLayout(hoursGroup); //5 x 7
connect(allHours, SIGNAL(clicked()), SLOT(slotAllHours()));
connect(allHours, SIGNAL(clicked()), SLOT(slotWizard()));
- logDebug() << "Create hours group" << endl;
+ logDebug() << "Create hours group";
return hoursGroup;
}
QString path = pathCommand.at(0);
QString binaryCommand = pathCommand.at(1);
- logDebug() << "Looking for " << binaryCommand << "in" << path << endl;
+ logDebug() << "Looking for " << binaryCommand << "in" << path;
bool found = false;
bool exec = false;
void TaskEditorDialog::slotMinutesPreselection(int index) {
QVariant itemData = minutesPreselection->itemData(index);
int step = itemData.toInt();
- logDebug() << "Selected step " << step << endl;
+ logDebug() << "Selected step " << step;
if (step == -1) {
//Unselect everything
connect(treeWidget(), SIGNAL(itemSelectionChanged()), this, SLOT(changeCurrentSelection()));
- logDebug() << "Tasks list created" << endl;
+ logDebug() << "Tasks list created";
}
TasksWidget::~TasksWidget() {
CTCron* ctCron = crontabWidget()->currentCron();
if (ctCron == NULL) {
- logDebug() << "Unable to find the related CtCron, please report this bug to KCron developer" << endl;
+ logDebug() << "Unable to find the related CtCron, please report this bug to KCron developer";
return;
}
}
- logDebug() << "End of modification" << endl;
+ logDebug() << "End of modification";
}
void TasksWidget::deleteSelection() {
- logDebug() << "Selection deleting..." << endl;
+ logDebug() << "Selection deleting...";
QList<QTreeWidgetItem*> tasksItems = treeWidget()->selectedItems();
changeCurrentSelection();
}
- logDebug() << "End of deletion" << endl;
+ logDebug() << "End of deletion";
}
void TasksWidget::refreshTasks(CTCron* cron) {
}
void TasksWidget::changeCurrentSelection() {
- //logDebug() << "Change selection..." << endl;
+ //logDebug() << "Change selection...";
if (treeWidget()->topLevelItemCount()==0) {
togglePrintAction(false);
connect(treeWidget(), SIGNAL(itemSelectionChanged()), this, SLOT(changeCurrentSelection()));
- logDebug() << "Variables list created" << endl;
+ logDebug() << "Variables list created";
}
}
void VariablesWidget::addVariable(CTVariable* variable) {
- logDebug() << "Add a new variable" << endl;
+ logDebug() << "Add a new variable";
crontabWidget()->currentCron()->addVariable(variable);
new VariableWidget(this, variable);
}
void VariablesWidget::changeCurrentSelection() {
- logDebug() << "Change selection..." << endl;
+ logDebug() << "Change selection...";
bool enabled;
if (treeWidget()->selectedItems().isEmpty())
#include <QFile>
#include <QTextDocument>
+#include <QTextStream>
+
class KDirWatch;
class FileWatcherTextItem;
AbstractTaskItem *TaskGroupItem::createAbstractItem(TaskManager::AbstractGroupableItem *groupableItem)
{
- //kDebug() << "item to create" << groupableItem << endl;
+ //kDebug() << "item to create" << groupableItem;
AbstractTaskItem *item = 0;
if (groupableItem->itemType() == TaskManager::GroupItemType) {
{
srcUrl = mostLocalUrl(srcUrl);
// Note: destDir may actually be a full path to a file :-(
- kDebug(5001) << "Source:" << srcUrl.url() << ", dest: " << destDir << ", sugg file: " << suggestedFileName << endl;
+ kDebug(5001) << "Source:" << srcUrl.url() << ", dest: " << destDir << ", sugg file: " << suggestedFileName;
KUrl destUrl; // the final destination, including filename
for ( int i = 0; i < offers.count(); ++i )
{
services[ offers[i]->property( "X-KDE-KGet-rank" ).toInt() ] = offers[i];
- kDebug(5001) << " TransferFactory plugin found:" << endl <<
- " rank = " << offers[i]->property( "X-KDE-KGet-rank" ).toInt() << endl <<
- " plugintype = " << offers[i]->property( "X-KDE-KGet-plugintype" ) << endl;
+ kDebug(5001) << " TransferFactory plugin found:\n" <<
+ " rank = " << offers[i]->property( "X-KDE-KGet-rank" ).toInt() << '\n' <<
+ " plugintype = " << offers[i]->property( "X-KDE-KGet-plugintype" );
}
//I must fill this pluginList before and my m_transferFactories list after.
#include "core/transferhistorystore_xml_p.h"
#include <QDateTime>
+#include <QTextStream>
#include <QtXml/qdom.h>
#include <QFile>
#include <QThread>
if (parent.isValid())
kDebug(5001) << "TransferTreeModel::dropMimeData" << " " << row << " "
- << column << endl;
+ << column;
QList<QWeakPointer<TransferHandler> > transfers = itemData->transfers();
kDebug(5001) << "TransferTreeModel::dropMimeData:" << transfers.count() << "transfers.";
break;
}
-// kDebug(5001) << it.key() << ": " << it.value() << endl;
+ // kDebug(5001) << it.key() << ": " << it.value();
}
if (update)
{
if ( !_mixer->isDynamic())
// This should never ever happen, as KMix does NOT accept soundcards without controls
- kError(67100) << "Mixer_Backend::recommendedMaster(): returning invalid master. This is a bug in KMix. Please file a bug report stating how you produced this." << endl;
+ kError(67100) << "Mixer_Backend::recommendedMaster(): returning invalid master. This is a bug in KMix. Please file a bug report stating how you produced this.";
}
// If we reach this code path, then obiously m_recommendedMaster == 0 (see above)
minfo.dev = -1;
if ( wrapIoctl( ioctl(m_fd, SNDCTL_MIXERINFO, &minfo) ) < 0 )
{
- kDebug(67100) << "Can't get mixerinfo from card!\n" << endl;
+ kDebug(67100) << "Can't get mixerinfo from card!";
return false;
}
if (!minfo.enabled)
{
// Mixer is disabled. Probably disconnected USB device or card is unavailable;
- kDebug(67100) << "Mixer for card is disabled!\n" << endl;
+ kDebug(67100) << "Mixer for card is disabled!";
close();
return false;
}
if ( wrapIoctl( ioctl(m_fd, SNDCTL_MIX_EXTINFO, &extinfo) ) < 0 )
{
//TO DO: more specific error handling
- kDebug ( 67100 ) << "failed to read info for control " << id2num(id) << endl;
+ kDebug ( 67100 ) << "failed to read info for control " << id2num(id);
return Mixer::ERR_READ;
}
if ( wrapIoctl ( ioctl (m_fd, SNDCTL_MIX_WRITE, &mv) ) < 0 )
{
- kDebug ( 67100 ) << "error writing to control" << extinfo.extname << endl;
+ kDebug ( 67100 ) << "error writing to control" << extinfo.extname;
return Mixer::ERR_WRITE;
}
return 0;
if ( wrapIoctl ( ioctl(m_fd, SNDCTL_MIX_EXTINFO, &extinfo) ) < 0 )
{
//TO DO: more specific error handling
- kDebug ( 67100 ) << "failed to read info for control " << id2num(id) << endl;
+ kDebug ( 67100 ) << "failed to read info for control " << id2num(id);
return;
}
if ( wrapIoctl ( ioctl (m_fd, SNDCTL_MIX_WRITE, &mv) ) < 0 )
{
/* Oops, can't write to mixer */
- kDebug ( 67100 ) << "error writing to control" << extinfo.extname << endl;
+ kDebug ( 67100 ) << "error writing to control" << extinfo.extname;
}
}
{
case EIO:
{
- kDebug ( 67100 ) << "A hardware level error occurred" << endl;
+ kDebug ( 67100 ) << "A hardware level error occurred";
break;
}
case EINVAL:
{
- kDebug ( 67100 ) << "Operation caused an EINVAL. You may have found a bug in kmix OSS4 module or in OSS4 itself" << endl;
+ kDebug ( 67100 ) << "Operation caused an EINVAL. You may have found a bug in kmix OSS4 module or in OSS4 itself";
break;
}
case ENXIO:
{
- kDebug ( 67100 ) << "Operation index out of bounds or requested device does not exist - you likely found a bug in the kmix OSS4 module" << endl;
+ kDebug ( 67100 ) << "Operation index out of bounds or requested device does not exist - you likely found a bug in the kmix OSS4 module";
break;
}
case EPERM:
case EACCES:
{
- kDebug ( 67100 ) << errorText ( Mixer::ERR_PERM ) << endl;
+ kDebug ( 67100 ) << errorText ( Mixer::ERR_PERM );
break;
}
case ENODEV:
{
- kDebug ( 67100 ) << "kmix received an ENODEV error - are the OSS4 drivers loaded ?" << endl;
+ kDebug ( 67100 ) << "kmix received an ENODEV error - are the OSS4 drivers loaded ?";
break;
}
case EPIPE:
_moveDestinationMixSet = moveDestinationMixSet;
if ( _id.contains(' ') ) {
// The key is used in the config file. IdbusControlWrappert MUST NOT contain spaces
- kError(67100) << "MixDevice::setId(\"" << id << "\") . Invalid key - it must not contain spaces" << endl;
+ kError(67100) << "MixDevice::setId(\"" << id << "\") . Invalid key - it must not contain spaces";
_id.replace(' ', '_');
}
// kDebug(67100) << "MixDevice::init() _id=" << _id;
else
{
if ( !m_dynamic )
- kError(67100) << "Mixer::open() no master detected." << endl;
+ kError(67100) << "Mixer::open() no master detected.";
QString noMaster = "---no-master-detected---";
setLocalMasterMD(noMaster); // no master
}
KMixDeviceManager::instance()->setHotpluggingBackends(driverInfoUsed);
}
- kDebug(67100) << ref_hwInfoString << endl << "Total number of detected Mixers: " << Mixer::mixers().count();
+ kDebug(67100) << ref_hwInfoString << "\nTotal number of detected Mixers: " << Mixer::mixers().count();
//kDebug(67100) << "OUT MixerToolBox::initMixer()";
}
#include <kdebug.h>
#include <QList>
+#include <QMap>
class VolumeChannel;
if ( button != 0 ) {
QString viewName = button->objectName();
if ( mixer == 0 ) {
- kError(67100) << "DialogAddView::createPage(): Invalid Mixer (mixer=0)" << endl;
+ kError(67100) << "DialogAddView::createPage(): Invalid Mixer (mixer=0)";
return; // can not happen
}
else {
} // Read OK
else {
// !! this error message about faulty profiles should probably be surrounded with i18n()
- kError(67100) << "ERROR: The profile '" << ref_fileName<< "' contains errors, and is not used." << endl;
+ kError(67100) << "ERROR: The profile '" << ref_fileName<< "' contains errors, and is not used.";
}
delete gpp;
delete xmlReader;
QStringList qsl = sctls.split( ',', QString::SkipEmptyParts, Qt::CaseInsensitive);
foreach (const QString &sctl, qsl) {
- //kDebug() << "setSubcontrols found: " << sctl.toLocal8Bit().constData() << endl;
+ //kDebug() << "setSubcontrols found: " << sctl.toLocal8Bit().constData();
if ( sctl == "pvolume" ) _useSubcontrolPlayback = true;
else if ( sctl == "cvolume" ) _useSubcontrolCapture = true;
else if ( sctl == "pswitch" ) _useSubcontrolPlaybackSwitch = true;
kDebug(67100) << "KSmallSlider::paintEvent: sliderPos=" << sliderPos
<< "height()=" << height()
<< "width()=" << width()
- << "outer = " << outer << endl;
+ << "outer = " << outer;
*/
if ( grayed )
gradient( p, false, outer,
_enumCombo->setCurrentIndex( m_mixdevice->enumId() );
}
else {
- kError(67100) << "MDWEnum::update() enumID=" << m_mixdevice->enumId() << " is no Enum ... skipped" << endl;
+ kError(67100) << "MDWEnum::update() enumID=" << m_mixdevice->enumId() << " is no Enum ... skipped";
}
}
}
else
{
- kError(67100) << "Pixmap missing. filename=" << filename << endl;
+ kError(67100) << "Pixmap missing. filename=" << filename;
}
}
kDebug() << "Got image. bpp: " << d->framebufferImage->bits_per_pixel
<< ", depth: " << d->framebufferImage->depth
<< ", padded width: " << d->framebufferImage->bytes_per_line
- << " (sent: " << d->framebufferImage->width * 4 << ")"
- << endl;
+ << " (sent: " << d->framebufferImage->width * 4 << ")";
fb = d->framebufferImage->data;
#ifdef HAVE_XDAMAGE
}
void ConfigurationDialog::setupLogModeConfigurations() {
- logDebug() << "Setup Log Mode Configurations..." << endl;
+ logDebug() << "Setup Log Mode Configurations...";
foreach(LogMode* logMode, Globals::instance()->logModes()) {
foreach (LogModeConfigurationWidget* logModeConfigurationWidget, d->logModeConfigurations ) {
- logDebug() << "Adding " << logModeConfigurationWidget->itemName() << " configuration..." << endl;
+ logDebug() << "Adding " << logModeConfigurationWidget->itemName() << " configuration...";
addPage(logModeConfigurationWidget, logModeConfigurationWidget->itemName(), logModeConfigurationWidget->iconName(), logModeConfigurationWidget->header(), false);
}
void ConfigurationDialog::showConfiguration() {
- logDebug() << "Showing Configuration dialog..." << endl;
+ logDebug() << "Showing Configuration dialog...";
show();
}
}
void ConfigurationDialog::updateSettings() {
- logDebug() << "Saving configuration..." << endl;
+ logDebug() << "Saving configuration...";
d->changed = false;
emit configurationSaved();
- logDebug() << "Configuration saved" << endl;
+ logDebug() << "Configuration saved";
}
bool ConfigurationDialog::hasChanged() {
- logDebug() << "Current change status : " << d->changed << endl;
+ logDebug() << "Current change status : " << d->changed;
return d->changed;
}
void ConfigurationDialog::updateConfiguration() {
- logDebug() << "Updating configuration..." << endl;
+ logDebug() << "Updating configuration...";
bool valid = d->generalConfiguration->isValid();
if (valid) {
}
void ConfigurationDialog::updateButtons() {
- logDebug() << "Updating configuration buttons..." << endl;
+ logDebug() << "Updating configuration buttons...";
d->changed = true;
}
void ConfigurationDialog::updateWidgets() {
- logDebug() << "Reading configuration..." << endl;
+ logDebug() << "Reading configuration...";
d->generalConfiguration->readConfig();
foreach (LogModeConfigurationWidget* logModeConfigurationWidget, d->logModeConfigurations ) {
}
void ConfigurationDialog::updateWidgetsDefault() {
- logDebug() << "Loading default configuration..." << endl;
+ logDebug() << "Loading default configuration...";
d->generalConfiguration->defaultConfig();
foreach (LogModeConfigurationWidget* logModeConfigurationWidget, d->logModeConfigurations ) {
//TODO Try to find a method that reload (an resize) correctly the content of the detail dialog
void DetailDialog::updateDetails() {
- //logDebug() << "Updating Detail Dialog..." << endl;
+ //logDebug() << "Updating Detail Dialog...";
//Get the current-last item selected
LogViewWidgetItem* item=logViewWidget->lastSelectedItem();
if (item==NULL) {
- logDebug() << "No item found." << endl;
+ logDebug() << "No item found.";
return;
}
void DetailDialog::moveToItem(int direction) {
if (direction < 0)
- logDebug() << "Go to previous item..." << endl;
+ logDebug() << "Go to previous item...";
else
- logDebug() << "Go to next item..." << endl;
+ logDebug() << "Go to next item...";
//Get the current-last item selected
LogViewWidgetItem* item=logViewWidget->lastSelectedItem();
if (item==NULL) {
- logDebug() << "No item found." << endl;
+ logDebug() << "No item found.";
return;
}
QTreeWidgetItem* destinationItem = logViewWidget->topLevelItem( logViewWidget->indexOfTopLevelItem(item) + direction );
if (destinationItem==NULL) {
if (direction < 0)
- logDebug() << "No previous item found." << endl;
+ logDebug() << "No previous item found.";
else
- logDebug() << "No next item found." << endl;
+ logDebug() << "No next item found.";
return;
}
}
void GeneralConfigurationWidget::saveConfig() const {
- logDebug() << "Save config from General preferences" << endl;
+ logDebug() << "Save config from General preferences";
KSystemLogConfig::setStartupLogMode(startupLogMode->itemData(startupLogMode->currentIndex()).toString());
bool GeneralConfigurationWidget::isValid() const {
if (maxLines->value()>0) {
- logDebug() << "General configuration valid" << endl;
+ logDebug() << "General configuration valid";
return true;
}
- logDebug() << "General configuration not valid" << endl;
+ logDebug() << "General configuration not valid";
return false;
}
// Remove the watching on the monitored files
foreach (LogFileReader* logFileReader, logFileReaders) {
- logDebug() << "Remove file : " << logFileReader->logFile().url().path() << endl;
+ logDebug() << "Remove file : " << logFileReader->logFile().url().path();
delete logFileReader;
}
bool watching;
//If we resume the parsing, then parse files to know if new lines have been appended
if (parsingPaused==true) {
- logDebug() << "Pausing reading" << endl;
+ logDebug() << "Pausing reading";
watching=false;
}
else {
- logDebug() << "Relaunch reading" << endl;
+ logDebug() << "Relaunch reading";
watching=true;
}
void Analyzer::logFileChanged(LogFileReader* logFileReader, ReadingMode readingMode, const QStringList& content) {
if (readingMode == Analyzer::FullRead)
- logDebug() << "File " << logFileReader->logFile().url().path() << " has been modified on full read." << endl;
+ logDebug() << "File " << logFileReader->logFile().url().path() << " has been modified on full read.";
else
- logDebug() << "File " << logFileReader->logFile().url().path() << " has been modified on partial read" << endl;
+ logDebug() << "File " << logFileReader->logFile().url().path() << " has been modified on partial read";
if (parsingPaused == true) {
- logDebug() << "Pause enabled. Nothing read." << endl;
+ logDebug() << "Pause enabled. Nothing read.";
return;
}
- logDebug() << "Locking file modifications of " << logFileReader->logFile().url().path() << endl;
+ logDebug() << "Locking file modifications of " << logFileReader->logFile().url().path();
QMutexLocker locker(insertionLocking);
- logDebug() << "Unlocking file modifications of " << logFileReader->logFile().url().path() << endl;
+ logDebug() << "Unlocking file modifications of " << logFileReader->logFile().url().path();
QTime benchmark;
benchmark.start();
insertedLogLineCount = insertLines(content, logFileReader->logFile(), Analyzer::UpdatingRead);
}
else {
- logDebug() << "Reading file "<< logFileReader->logFile().url().path() << endl;
+ logDebug() << "Reading file "<< logFileReader->logFile().url().path();
emit statusBarChanged( i18n("Opening '%1'...", logFileReader->logFile().url().path()) );
//Inform MainWindow status bar
emit statusBarChanged( i18n("Log file '%1' has changed.", logFileReader->logFile().url().path()) );
- logDebug() << "Updating log files in " << benchmark.elapsed() << " ms" << endl;
+ logDebug() << "Updating log files in " << benchmark.elapsed() << " ms";
}
int Analyzer::insertLines(const QStringList& bufferedLines, const LogFile& logFile, ReadingMode readingMode) {
- logDebug() << "Inserting lines..." << endl;
+ logDebug() << "Inserting lines...";
//If there is no line
if (bufferedLines.size()==0) {
- logWarning() << "File is empty : " << logFile.url().path() << endl;
+ logWarning() << "File is empty : " << logFile.url().path();
}
*
* TODO Read revertly the file and ignore last lines if we are in Descending mode
*/
- logDebug() << "Log file Sort mode is " << logFileSortMode() << endl;
+ logDebug() << "Log file Sort mode is " << logFileSortMode();
if (logFileSortMode() == Analyzer::AscendingSortedLogFile) {
//Calculate how many lines we will ignore
if (bufferedLines.size() > KSystemLogConfig::maxLines()) {
++currentPosition;
}
- logDebug() << "Total read lines :"<< (bufferedLines.size() - stop) << "(" << logFile.url().path() << ")" << endl;
+ logDebug() << "Total read lines :"<< (bufferedLines.size() - stop) << "(" << logFile.url().path() << ")";
return insertedLogLineCount;
}
connect(& (d->fileWatch), SIGNAL(timeout()), this, SLOT(watchFile()));
*/
- logDebug() << "Starting " << logFile.url().path() << endl;
+ logDebug() << "Starting " << logFile.url().path();
}
}
void KioLogFileReader::open() {
- logDebug() << "Opening..." << endl;
+ logDebug() << "Opening...";
d->fileJob = KIO::open(d->logFile.url(), QIODevice::ReadOnly | QIODevice::Text);
connect(d->fileJob, SIGNAL(open(KIO::Job*)), this, SLOT(openDone(KIO::Job*)));
connect(d->fileJob, SIGNAL(data(KIO::Job*,QByteArray)), this, SLOT(dataReceived(KIO::Job*,QByteArray)));
connect(d->fileJob, SIGNAL(mimetype(KIO::Job*,QString)), this, SLOT(mimetypeReceived(KIO::Job*,QString)));
- logDebug() << "File opened." << endl;
+ logDebug() << "File opened.";
}
void KioLogFileReader::close() {
}
void KioLogFileReader::openDone(KIO::Job* job) {
- logDebug() << "Opening done..." << endl;
+ logDebug() << "Opening done...";
d->fileJob->read(READ_SIZE);
}
void KioLogFileReader::closeDone(KIO::Job* job) {
- logDebug() << "Closing done..." << endl;
+ logDebug() << "Closing done...";
}
void KioLogFileReader::dataReceived(KIO::Job* job, const QByteArray& data) {
if (job != d->fileJob) {
- logDebug() << "Not the good job" << endl;
+ logDebug() << "Not the good job";
return;
}
return;
}
- //logDebug() << "Receiving data... (" << d->totalRead << ")" << endl;
+ //logDebug() << "Receiving data... (" << d->totalRead << ")";
d->buffer.append(QLatin1String( data ));
d->totalRead += data.size();
emitCompleteLines();
- logDebug() << "Total read : " << d->totalRead << " of " << d->fileJob->size() << endl;
+ logDebug() << "Total read : " << d->totalRead << " of " << d->fileJob->size();
if (d->totalRead < d->fileJob->size()) {
d->fileJob->read(READ_SIZE);
}
- //logDebug() << "Data received : " << d->buffer << endl;
+ //logDebug() << "Data received : " << d->buffer;
//d->totalRead++;
}
}
void KioLogFileReader::mimetypeReceived(KIO::Job* job, const QString& type) {
- logDebug() << "Mimetype received " << type << endl;
+ logDebug() << "Mimetype received " << type;
}
void KioLogFileReader::watchFile(const QString& path) {
- logDebug() << "Watch file : size : " << path << endl;
+ logDebug() << "Watch file : size : " << path;
}
#include "moc_kioLogFileReader.cpp"
m_btnGroup->addButton(button, level->id());
m_btnGroupLayout->addWidget(button, row, col);
- logDebug() << "name: " << level->name() << " id: " << level->id() << endl;
+ logDebug() << "name: " << level->name() << " id: " << level->id();
row++;
if(row >= 4) {
#include <QMutex>
#include <QBuffer>
#include <QFile>
+#include <QTextStream>
#include <kdirwatch.h>
#include <klocale.h>
#include "logFileReader.h"
#include "logFileReaderPrivate.h"
-
#include "logging.h"
//Init current file position
d->previousFilePosition = 0;
- logDebug() << "Reading local file " << d->logFile.url().path() << endl;
+ logDebug() << "Reading local file " << d->logFile.url().path();
}
Q_D(LocalLogFileReader);
if (enable == true) {
- logDebug() << "Monitoring file : " << d->logFile.url().path() << endl;
+ logDebug() << "Monitoring file : " << d->logFile.url().path();
if (d->watch->contains(d->logFile.url().path()) == false) {
d->watch->addFile(d->logFile.url().path());
QString mimeType = KMimeType::findByFileContent( d->logFile.url().path() )->name();
- logDebug() << d->logFile.url().path() << " : " << mimeType << endl;
+ logDebug() << d->logFile.url().path() << " : " << mimeType;
QIODevice* inputDevice;
//Try to see if this file exists
//Plain text file : we use a QFile object
if (mimeType == QLatin1String( "text/plain" ) || mimeType == QLatin1String( "application/octet-stream" )) {
- logDebug() << "Using QFile input device" << endl;
+ logDebug() << "Using QFile input device";
inputDevice = file;
}
//Compressed file : we use the KFilterDev helper
else {
- logDebug() << "Using KFilterDev input device" << endl;
+ logDebug() << "Using KFilterDev input device";
const QString logFilePath = d->logFile.url().path();
KDecompressor kdecompressor;
}
QStringList LocalLogFileReader::readContent(QIODevice* inputDevice) {
- logDebug() << "Retrieving raw buffer..."<< endl;
+ logDebug() << "Retrieving raw buffer...";
Q_D(LocalLogFileReader);
rawBuffer.append(inputStream.readLine());
}
- logDebug() << "Raw buffer retrieved."<< endl;
+ logDebug() << "Raw buffer retrieved.";
//Get the size file for the next calculation
d->previousFilePosition = inputDevice->size();
- logDebug() << "New file position : " << d->previousFilePosition << " (" << d->logFile.url().path() << ")" << endl;
+ logDebug() << "New file position : " << d->previousFilePosition << " (" << d->logFile.url().path() << ")";
return rawBuffer;
}
void LocalLogFileReader::logFileModified() {
Q_D(LocalLogFileReader);
- logDebug() << "Locking log file modification..." << endl;
+ logDebug() << "Locking log file modification...";
if (d->insertionLocking.tryLock() == false) {
- logDebug() << "Log file modification already detected." << endl;
+ logDebug() << "Log file modification already detected.";
return;
}
QIODevice* inputDevice = open();
if (inputDevice == NULL) {
- logError() << "Could not open file " << d->logFile.url().path() << endl;
+ logError() << "Could not open file " << d->logFile.url().path();
return;
}
//If there are new lines in the file, insert only them or this is the first time we read this file
if (d->previousFilePosition!=0 && d->previousFilePosition <= inputDevice->size()) {
- logDebug() << "Reading from position " << d->previousFilePosition << " (" << d->logFile.url().path() << ")" << endl;
+ logDebug() << "Reading from position " << d->previousFilePosition << " (" << d->logFile.url().path() << ")";
if (inputDevice->isSequential()) {
- logError() << "The file current position could not be modified" << endl;
+ logError() << "The file current position could not be modified";
}
else {
//Place the cursor to the last line opened
inputDevice->seek(d->previousFilePosition);
}
- logDebug() << "Retrieving a part of the file..."<< endl;
+ logDebug() << "Retrieving a part of the file...";
emit contentChanged(this, Analyzer::UpdatingRead, readContent(inputDevice));
}
//Else reread all lines, clear log list
else {
- logDebug() << "New file or file truncated. (Re-)Loading log file" << endl;
+ logDebug() << "New file or file truncated. (Re-)Loading log file";
emit contentChanged(this, Analyzer::FullRead, readContent(inputDevice));
close(inputDevice);
- logDebug() << "Unlocking log file modification..." << endl;
+ logDebug() << "Unlocking log file modification...";
d->insertionLocking.unlock();
}
QString exporting;
if (d->item == NULL) {
- logError() << "Trying to export text from NULL item" << endl;
+ logError() << "Trying to export text from NULL item";
return exporting;
}
void LogManager::reload() {
if (d->logMode == NULL) {
- logWarning() << "Log manager is not yet initialized" << endl;
+ logWarning() << "Log manager is not yet initialized";
return;
}
- logDebug() << "Reloading with log mode " << d->logMode->name() << "..." << endl;
+ logDebug() << "Reloading with log mode " << d->logMode->name() << "...";
emit statusBarChanged(i18n("Loading log..."));
emit tabTitleChanged(d->usedView, d->logMode->icon(), d->logMode->name());
emit windowTitleChanged(d->logMode->name());
- logDebug() << "Emptying view..." << endl;
+ logDebug() << "Emptying view...";
// Empty the current list, to better fill it
d->usedView->logViewWidget()->model()->clear();
- logDebug() << "Initializing view..." << endl;
+ logDebug() << "Initializing view...";
// Init the Log View
- logDebug() << "Initializing columns view..." << endl;
+ logDebug() << "Initializing columns view...";
d->usedView->logViewWidget()->setColumns(d->analyzer->initColumns());
- logDebug() << "Reading log..." << endl;
+ logDebug() << "Reading log...";
// Read the log files
d->analyzer->watchLogFiles(true);
// Log List has been totally reloaded
emit reloaded();
- logDebug() << "Log mode " << d->logMode->name() << " reloaded" << endl;
+ logDebug() << "Log mode " << d->logMode->name() << " reloaded";
}
}
void LogManager::updateLog(int lineCount) {
- logDebug() << "Updating log " << lineCount << " new lines" << endl;
+ logDebug() << "Updating log " << lineCount << " new lines";
if (lineCount==0)
return;
}
void LogManager::cleanPreviousLogMode() {
- logDebug() << "Cleaning previous LogMode..." << endl;
+ logDebug() << "Cleaning previous LogMode...";
d->logMode = NULL;
}
void LogManager::internalInitialize(LogMode* mode, const QList<LogFile>& logFiles) {
- logDebug() << "Initializing LogManager..." << endl;
+ logDebug() << "Initializing LogManager...";
- logDebug() << "Using files" << logFiles << endl;
+ logDebug() << "Using files" << logFiles;
cleanPreviousLogMode();
//Find the log files used for this kind of mode, and set them to our log manager
d->analyzer->setLogFiles(logFiles);
- logDebug() << "LogManager initialized" << endl;
+ logDebug() << "LogManager initialized";
}
void LogManager::setParsingPaused(bool paused) {
if (d->logMode == NULL) {
- logWarning() << "Log manager is not yet initialized" << endl;
+ logWarning() << "Log manager is not yet initialized";
return;
}
bool LogManager::isParsingPaused() const {
if (d->logMode == NULL) {
- logWarning() << "Log manager is not yet initialized" << endl;
+ logWarning() << "Log manager is not yet initialized";
return false;
}
}
void LogManager::loadDroppedUrls(const KUrl::List& urls) {
- logDebug() << "Drop " << urls << endl;
+ logDebug() << "Drop " << urls;
QList<LogFile> logFiles;
return reader;
}
- logError() << "LogMode not found : returns NULL Reader" << endl;
+ logError() << "LogMode not found : returns NULL Reader";
return NULL;
}
*/
return LogFilesFactory::getXSessionLogFiles();
}
- logError() << "LogFiles not found : returns NULL Reader" << endl;
+ logError() << "LogFiles not found : returns NULL Reader";
return QList<LogFile>();
KUrl url(file);
if (!url.isValid()) {
- logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path()) << endl;
+ logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path());
return LogFile(KUrl(), Globals::instance()->noLogLevel());
}
KUrl url(string);
if (!url.isValid()) {
- logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path()) << endl;
+ logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path());
continue;
}
#include <QPrintDialog>
#include <QPen>
#include <QFile>
+#include <QTextStream>
#include <kapplication.h>
#include <klocale.h>
}
void LogViewExport::sendMail() {
- logDebug() << "Exporting to mail..." << endl;
+ logDebug() << "Exporting to mail...";
QString body(i18n("Here are my logs:\n"));
}
void LogViewExport::printSelection() {
- logDebug() << "Printing selection..." << endl;
+ logDebug() << "Printing selection...";
QPrinter printer;
}
void LogViewExport::printPageNumber(QPainter& painter, QRect& printView, int movement, int page) {
- logDebug() << "Printing page number..." << endl;
+ logDebug() << "Printing page number...";
painter.translate(0, -movement);
printView.moveTo(QPoint(0, printView.height()) );
}
void LogViewExport::copyToClipboard() {
- logDebug() << "Copying to clipboard..." << endl;
+ logDebug() << "Copying to clipboard...";
int nbCopied=0;
QString text;
emit statusBarChanged(i18np("1 log line copied to clipboard.", "%1 log lines copied to clipboard.", nbCopied));
}
- logDebug() << "Copied " << nbCopied << " log lines" << endl;
+ logDebug() << "Copied " << nbCopied << " log lines";
}
void LogViewExport::fileSave() {
- logDebug() << "Saving to a file..." << endl;
+ logDebug() << "Saving to a file...";
QTreeWidgetItemIterator it(logViewWidget, QTreeWidgetItemIterator::Selected);
}
void LogViewFilterWidget::updateFilterColumns(const LogViewColumns& columns) {
- logDebug() << "Changing columns..." << endl;
+ logDebug() << "Changing columns...";
//We first delete all items
d->filterList->clear();
void LogViewFilterWidget::changeColumnFilter(int column) {
//The user select all columns
if (column==0) {
- logDebug() << "Searching on all columns" << endl;
+ logDebug() << "Searching on all columns";
d->filterLine->setSearchColumns(QList<int>());
return;
}
- logDebug() << "Searching on " << d->filterList->currentIndex() << " column" << endl;
+ logDebug() << "Searching on " << d->filterList->currentIndex() << " column";
QList<int> filterColumns;
//currentIndex() - 1 to do not count the "All" columns item
d->concurrentMultipleInsertions++;
if (hasLocked == true) {
- logDebug() << "Starting multiple insertions..." << endl;
+ logDebug() << "Starting multiple insertions...";
emit( processingMultipleInsertions(true) );
d->concurrentMultipleInsertions--;
if (lockMultipleInsertions() == true) {
- logDebug() << "Ending multiple insertions..." << endl;
+ logDebug() << "Ending multiple insertions...";
//Scroll to the newest item if some lines have been added
if (insertedLogLineCount>0) {
d->logViewWidget->resizeColumns();
}
- logDebug() << "Enabling log view widget refresh..." << endl;
+ logDebug() << "Enabling log view widget refresh...";
d->logViewWidget->setUpdatesEnabled(true);
emit( processingMultipleInsertions(false) );
//Debug messages
if (d->concurrentMultipleInsertions > 0) {
- logDebug() << "Existing multiple insertions request is still active" << endl;
+ logDebug() << "Existing multiple insertions request is still active";
}
else if (d->concurrentMultipleInsertions < 0) {
- logError() << "Existing multiple insertions forgot to call this method" << endl;
+ logError() << "Existing multiple insertions forgot to call this method";
}
return false;
}
void LogViewModel::removeOldestLogLine() {
- //logDebug() << "Removing oldest log line" << endl;
+ //logDebug() << "Removing oldest log line";
if (isEmpty()==true) {
return;
}
if (d->oldestItem==NULL) {
- logWarning() << "Oldest item is null" << endl;
+ logWarning() << "Oldest item is null";
return;
}
return true;
}
- //logDebug() << "Do not insert an old line : " << line->logItems() << endl;
+ //logDebug() << "Do not insert an old line : " << line->logItems();
return false;
}
}
void LogViewSearchWidget::findNext() {
- logDebug() << "Finding next" << endl;
+ logDebug() << "Finding next";
LogViewWidgetItem* lastSelectedItem = d->logViewWidget->lastSelectedItem();
internalFind(lastSelectedItem, LogViewSearchWidget::Next);
}
void LogViewSearchWidget::findPrevious() {
- logDebug() << "Finding previous" << endl;
+ logDebug() << "Finding previous";
LogViewWidgetItem* firstSelectedItem = d->logViewWidget->firstSelectedItem();
internalFind(firstSelectedItem, LogViewSearchWidget::Previous);
if (highlightAllButton->isChecked()) {
unlightAll();
- logDebug() << "Highlighting all" << endl;
+ logDebug() << "Highlighting all";
QTreeWidgetItemIterator it(d->logViewWidget, QTreeWidgetItemIterator::All);
while ( *it != NULL ) {
LogViewWidgetItem* item=static_cast<LogViewWidgetItem*> (*it);
}
void LogViewSearchWidget::unlightAll() {
- logDebug() << "Unlighting all" << endl;
+ logDebug() << "Unlighting all";
QTreeWidgetItemIterator it(d->logViewWidget, QTreeWidgetItemIterator::All);
while ( *it != NULL ) {
}
void LogViewWidget::setColumns(const LogViewColumns& columns) {
- logDebug() << "Updating columns using " << columns << "..." << endl;
+ logDebug() << "Updating columns using " << columns << "...";
//First, delete all current columns
setColumnCount(0);
emit columnsChanged(columns);
- logDebug() << "Log View Widget updated..." << endl;
+ logDebug() << "Log View Widget updated...";
}
}
void LogViewWidget::toggleToolTip(bool enabled) {
- logDebug() << "Toggle tool tip " << enabled << endl;
+ logDebug() << "Toggle tool tip ";
QTreeWidgetItemIterator it(this);
while (*it != NULL) {
}
void LogViewWidget::scrollToNewestItem() {
- logDebug() << "Scrolling to the newest item..." << endl;
+ logDebug() << "Scrolling to the newest item...";
//Scroll to last item if requested
if (KSystemLogConfig::newLinesDisplayed() == true) {
}
void LogViewWidget::toggleHeader(QAction* action) {
- logDebug() << "Toggling header" << endl;
+ logDebug() << "Toggling header";
int columnIndex = action->data().toInt();
if (header()->isSectionHidden(columnIndex) == true)
* - logFatal()
*
* Use it like kDebug() function :
- * logDebug() << "Debug message" << list.size() << endl;
+ * logDebug() << "Debug message" << list.size();
*/
/*
d->processUpdater.setInterval(PROCESS_OUTPUT_UPDATER_INTERVAL);
connect(&(d->processUpdater), SIGNAL(timeout()), this, SLOT(startProcess()));
- logDebug() << "Using process name " << d->logFile.url().path() << endl;
+ logDebug() << "Using process name " << d->logFile.url().path();
}
void ProcessOutputLogFileReader::watchFile(bool enable) {
Q_D(ProcessOutputLogFileReader);
if (enable == true) {
- logDebug() << "Monitoring process : " << d->logFile.url().path() << endl;
+ logDebug() << "Monitoring process : " << d->logFile.url().path();
//Reinit current file position
d->previousLinesCount = 0;
}
void ProcessOutputLogFileReader::startProcess() {
- logDebug() << "Starting process..." << endl;
+ logDebug() << "Starting process...";
Q_D(ProcessOutputLogFileReader);
emit statusBarChanged(message);
}
- logDebug() << "Starting process..." << endl;
+ logDebug() << "Starting process...";
d->process = new QProcess();
connect(d->process, SIGNAL(readyReadStandardOutput()), this, SLOT(logFileModified()));
d->process->waitForStarted();
- logDebug() << "Process started" << endl;
+ logDebug() << "Process started";
}
void ProcessOutputLogFileReader::closeProcess() {
- logDebug() << "Closing process..." << endl;
+ logDebug() << "Closing process...";
Q_D(ProcessOutputLogFileReader);
//Get the size file for the next calculation
d->previousLinesCount = d->availableStandardOutput.count();
- logDebug() << "New lines count : " << d->previousLinesCount << " (" << d->logFile.url().path() << ")" << endl;
+ logDebug() << "New lines count : " << d->previousLinesCount << " (" << d->logFile.url().path() << ")";
d->availableStandardOutput.clear();
d->process = NULL;
}
- logDebug() << "Process closed" << endl;
+ logDebug() << "Process closed";
}
void ProcessOutputLogFileReader::emitProcessOutput(int /*exitCode*/, QProcess::ExitStatus exitStatus) {
//First commit last lines of the buffer to the line list
emptyBuffer();
- logDebug() << "Process terminated" << d->previousLinesCount << "previously /" << d->availableStandardOutput.count() << "currently" << endl;
+ logDebug() << "Process terminated" << d->previousLinesCount << "previously /" << d->availableStandardOutput.count() << "currently";
if (exitStatus==QProcess::CrashExit) {
QString message(i18n("The process '%1' crashed.", d->logFile.url().path()));
}
// If there are new lines in the file, insert only them or this is the first time we read this file
else if (d->previousLinesCount!=0 && d->previousLinesCount <= d->availableStandardOutput.count()) {
- logDebug() << "Reading from line " << d->previousLinesCount << " (" << d->logFile.url().path() << ")" << endl;
+ logDebug() << "Reading from line " << d->previousLinesCount << " (" << d->logFile.url().path() << ")";
QStringList newOutputs;
++index;
}
- logDebug() << "Retrieving a part of the file..."<< endl;
+ logDebug() << "Retrieving a part of the file...";
emit contentChanged(this, Analyzer::UpdatingRead, newOutputs);
}
// Else reread all lines, clear log list
else {
- logDebug() << "New process or process already read. Reading entire content" << endl;
+ logDebug() << "New process or process already read. Reading entire content";
emit contentChanged(this, Analyzer::FullRead, d->availableStandardOutput);
void ProcessOutputLogFileReader::logFileModified() {
Q_D(ProcessOutputLogFileReader);
- logDebug() << "Content available on process output..." << endl;
+ logDebug() << "Content available on process output...";
//New added lines
QByteArray bytesOutput = d->process->readAllStandardOutput();
endLinePos = d->buffer.indexOf(QLatin1String( "\n" ));
}
- logDebug() << "Received a total of" << d->availableStandardOutput.count() << "new lines" << endl;
+ logDebug() << "Received a total of" << d->availableStandardOutput.count() << "new lines";
}
Q_D(ProcessOutputLogFileReader);
if (d->buffer.isEmpty() == false) {
- logWarning() << "Buffer was not empty !!" << endl;
+ logWarning() << "Buffer was not empty !!";
d->availableStandardOutput.append(d->buffer);
d->buffer.clear();
}
//If URLs have been dropped
if (urls.isEmpty() ) {
- logWarning() << "Empty drag and drop" << endl;
+ logWarning() << "Empty drag and drop";
return;
}
//TODO Add a recognition of binary files (using the Url mimetype) and refuse them
if (fileInfo.isReadable() == false) {
- logWarning() << "The drag and dropped file is not readable " << url.path() << endl;
+ logWarning() << "The drag and dropped file is not readable " << url.path();
return;
}
if (fileInfo.isDir()) {
- logWarning() << "Tried to drag and drop a directory " << url.path() << endl;
+ logWarning() << "Tried to drag and drop a directory " << url.path();
return;
}
}
}
void LoggerDialog::initialize() {
- logDebug() << "Initializing Logger dialog..." << endl;
+ logDebug() << "Initializing Logger dialog...";
message->clear();
message->setFocus();
/*KSystemLog::MainWindow* mainWindow;*/
new KSystemLog::MainWindow();
for (int i = 0; i < args->count(); i++) {
- logDebug() << "Loading file " << args->url(i) << endl;
+ logDebug() << "Loading file " << args->url(i);
//TODO Implement this kind of loading
//LogManager* firstLogManager = d->tabs->createTab();
//d->tabs->load(Globals::instance()->findLogMode("openLogMode"), firstLogManager);
d->tabs = NULL;
d->statusBar = NULL;
- logDebug() << "Starting KSystemLog..." << endl;
+ logDebug() << "Starting KSystemLog...";
//Load log modes plugins
loadLogModePlugins();
//Create the GUI from XML configuration
- logDebug() << "Creating Gui..." << endl;
+ logDebug() << "Creating Gui...";
createGUI();
//TODO Improve the status bar to add a custom widget which shows an history of latest message, and add a LogLevel for each ones
// automatically save settings if changed: window size, toolbar
// position, icon size, etc. Also to add actions for the statusbar
// toolbar, and keybindings if necessary.
- logDebug() << "Setup Gui..." << endl;
+ logDebug() << "Setup Gui...";
setupGUI();
setupLogActions();
}
void MainWindow::setupTabLogViews() {
- logDebug() << "Creating tab widget..." << endl;
+ logDebug() << "Creating tab widget...";
d->tabs=new TabLogViewsWidget();
}
void MainWindow::prepareCreatedLogManager(LogManager* manager) {
- logDebug() << "Connecting to actions the new log manager and view..." << endl;
+ logDebug() << "Connecting to actions the new log manager and view...";
//Contextual menu Log Manager signals
QAction* separator;
}
void MainWindow::updateSelection() {
- //logDebug() << "Updating selection..." << endl;
+ //logDebug() << "Updating selection...";
LogManager* currentLogManager = d->tabs->activeLogManager();
}
void MainWindow::closeEvent(QCloseEvent *event) {
- logDebug() << "Saving configuration before exit..." << endl;
+ logDebug() << "Saving configuration before exit...";
//Write the config to the file
KSystemLogConfig::self()->writeConfig();
KXmlGuiWindow::closeEvent(event);
}
void MainWindow::updateStatusBar() {
- logDebug() << "Updating status bar..." << endl;
+ logDebug() << "Updating status bar...";
LogManager* currentManager=d->tabs->activeLogManager();
}
void MainWindow::toggleResumePauseParsing(bool paused) {
- logDebug() << "Pausing parsing : " << paused << endl;
+ logDebug() << "Pausing parsing : " << paused;
LogManager* currentLogManager = d->tabs->activeLogManager();
if (currentLogManager != NULL) {
currentLogManager->setParsingPaused(paused);
}
- logDebug() << "Parsing paused : " << paused << endl;
+ logDebug() << "Parsing paused : " << paused;
}
void MainWindow::changeResumePauseAction(bool paused) {
}
void MainWindow::showConfigurationDialog() {
- logDebug() << "Showing configuration dialog..." << endl;
+ logDebug() << "Showing configuration dialog...";
if (d->configurationDialog == NULL) {
d->configurationDialog = new ConfigurationDialog(this);
}
void MainWindow::showLogMessageDialog() {
- logDebug() << "Launching the Send message dialog box..." << endl;
+ logDebug() << "Launching the Send message dialog box...";
if (d->loggedDialog == NULL) {
d->loggedDialog = new LoggerDialog(this);
void MainWindow::changeCurrentTab() {
- logDebug() << "Tab has changed" << endl;
+ logDebug() << "Tab has changed";
LogManager* currentManager=d->tabs->activeLogManager();
//Updating Detail dialog
updateDetailDialog();
- logDebug() << "Tab changing done" << endl;
+ logDebug() << "Tab changing done";
}
/**
* later when this app is restored
*/
void MainWindow::saveProperties(KConfigGroup & /*configuration*/) {
- logDebug() << "Saving properties..." << endl;
+ logDebug() << "Saving properties...";
}
/**
* in 'saveProperties'
*/
void MainWindow::readProperties( const KConfigGroup& /*configuration*/) {
- logDebug() << "Reading properties..." << endl;
+ logDebug() << "Reading properties...";
}
void MainWindow::toggleFilterBar() {
- logDebug() << "Toggling filter bar..." << d->filterBarAction->isChecked() << endl;
+ logDebug() << "Toggling filter bar..." << d->filterBarAction->isChecked();
foreach (LogManager* manager, d->tabs->logManagers()) {
manager->usedView()->toggleLogViewFilter(d->filterBarAction->isChecked());
}
void MainWindow::showSearchBar() {
- logDebug() << "Showing search bar..." << endl;
+ logDebug() << "Showing search bar...";
LogManager* activeLogManager = d->tabs->activeLogManager();
}
void MainWindow::setupActions() {
- logDebug() << "Creating actions..." << endl;
+ logDebug() << "Creating actions...";
QAction* fileOpenAction = actionCollection()->addAction(KStandardAction::Open, this, SLOT(fileOpen()));
fileOpenAction->setToolTip(i18n("Open a file in KSystemLog"));
}
if (currentMode==NULL) {
- logError() << "The selected mode does not exist" << endl;
+ logError() << "The selected mode does not exist";
return;
}
- logDebug() << "Selecting " << currentMode->name() << " (" << currentMode->id() << ")" << endl;
+ logDebug() << "Selecting " << currentMode->name() << " (" << currentMode->id() << ")";
/*
//If the user uses the middle button OR left button + shift OR left button + control : = it opens the log in a new tab
date=QDate(year.toInt(), ParsingHelper::instance()->parseSyslogMonth(month), day.toInt());
time=QTime(hour.toInt(), min.toInt(), sec.toInt());
- //logDebug() << "Date=" << date.toString() << endl;
- //logDebug() << "Time=" << time.toString() << endl;
+ //logDebug() << "Date=" << date.toString();
+ //logDebug() << "Time=" << time.toString();
line=line.remove(0, dateEnd+2);
return (*it);
}
else {
- logError() << "New Log Level detected: Please send this log file to the KSystemLog developer to add it (" << type << ")" << endl;
+ logError() << "New Log Level detected: Please send this log file to the KSystemLog developer to add it (" << type << ")";
return Globals::instance()->noLogLevel();
}
}
public slots:
void saveConfig() {
- logDebug() << "Saving config from Apache Options..." << endl;
+ logDebug() << "Saving config from Apache Options...";
ApacheConfiguration* apacheConfiguration = Globals::instance()->findLogMode(QLatin1String( APACHE_LOG_MODE_ID ))->logModeConfiguration<ApacheConfiguration*>();
apacheConfiguration->setApachePaths(apacheFileList->paths(apachePathsId));
protected:
bool isValid() const {
if (apacheFileList->isOneOfCategoryEmpty()==true) {
- logDebug() << "Apache configuration not valid" << endl;
+ logDebug() << "Apache configuration not valid";
return false;
}
- logDebug() << "Apache configuration valid" << endl;
+ logDebug() << "Apache configuration valid";
return true;
}
fileListHelper(this)
{
- logDebug() << "Initializing file list..." << endl;
+ logDebug() << "Initializing file list...";
setupUi(this);
updateButtons();
- logDebug() << "File list initialized" << endl;
+ logDebug() << "File list initialized";
}
//If this Url uses a joker (i.e. : "/var/log/apache2/*")
if (url.fileName().contains(QLatin1Char( '*' ))) {
const QStringList foundPaths = expandJoker(url.path());
- logDebug() << "Found paths of " << url.path() << ":" << foundPaths << endl;
+ logDebug() << "Found paths of " << url.path() << ":" << foundPaths;
foreach(const QString &foundPath, foundPaths) {
paths.append(foundPath);
}
QStringList FileListHelper::expandJoker(const KUrl& url) {
QDir directory = QDir(url.path().left(url.path().count() - url.fileName().count()));
- logDebug() << "Dir " << directory.path() << endl;
+ logDebug() << "Dir " << directory.path();
QString filename = url.fileName();
if (filename.isEmpty()) {
GenericLogModeConfiguration::GenericLogModeConfiguration(const QString& configurationGroup, const QStringList& defaultLogFilesPaths, const QList<int> defaultLogFilesLevels) :
d(new GenericLogModeConfigurationPrivate()) {
- logDebug() << "Using Configuration Group : " << configurationGroup << endl;
+ logDebug() << "Using Configuration Group : " << configurationGroup;
configuration->setCurrentGroup(configurationGroup);
configuration->addItemStringList(QLatin1String( "LogFilesPaths" ), d->logFilesPaths, defaultLogFilesPaths, QLatin1String( "LogFilesPaths" ));
QList<LogFile> logFiles;
if (d->logFilesPaths.size() != d->logFilesLevels.size()) {
- logDebug() << i18n("The two arrays size are different, skipping the reading of log files.") << endl;
+ logDebug() << i18n("The two arrays size are different, skipping the reading of log files.");
return logFiles;
}
KUrl url(stringValue);
if (!url.isValid()) {
- logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path()) << endl;
+ logWarning() << i18n("URL '%1' is not valid, skipping this URL.", url.path());
continue;
}
FileList(parent, description)
{
- logDebug() << "Initializing specific file list..." << endl;
+ logDebug() << "Initializing specific file list...";
changeItem=new QPushButton(i18n("&Change Status..."));
changeItem->setToolTip(i18n("Change the level of the current file(s)"));
updateSpecificButtons();
- logDebug() << "Specific file list initialized" << endl;
+ logDebug() << "Specific file list initialized";
}
}
void LogLevelFileList::changeItemType() {
- logDebug() << "Changing item type..." << endl;
+ logDebug() << "Changing item type...";
LogLevelSelectionDialog logLevelSelectionDialog(this);
void LogLevelFileList::addPaths(const QStringList& stringList, const QList<int>& valueList) {
//A little security test
if (stringList.size() != valueList.size()) {
- logDebug() << i18n("The two arrays size are different, skipping the reading of generic paths.") << endl;
+ logDebug() << i18n("The two arrays size are different, skipping the reading of generic paths.");
return;
}
fileListHelper(this)
{
- logDebug() << "Initializing multiple file list..." << endl;
+ logDebug() << "Initializing multiple file list...";
setupUi(this);
updateButtons();
- logDebug() << "Multiple File list initialized" << endl;
+ logDebug() << "Multiple File list initialized";
}
}
void MultipleFileList::updateButtons() {
- logDebug() << "Updating buttons..." << endl;
+ logDebug() << "Updating buttons...";
if (isFileListsEmpty() == true)
fileListHelper.setEnabledAction(removeAll, false);
fileListHelper.setEnabledAction(down, false);
}
- logDebug() << "Buttons updated" << endl;
+ logDebug() << "Buttons updated";
}
bool MultipleFileList::isFileListsEmpty() const {
for (int i=0; i<fileList->topLevelItemCount(); ++i) {
if (categoryCount(i) != 0) {
- logDebug() << "Is not empty" << endl;
+ logDebug() << "Is not empty";
return false;
}
}
- logDebug() << "Is empty" << endl;
+ logDebug() << "Is empty";
return true;
}
bool MultipleFileList::isOneOfCategoryEmpty() const {
for (int i=0; i<fileList->topLevelItemCount(); ++i) {
if (categoryCount(i) == 0) {
- logDebug() << "A category is empty" << endl;
+ logDebug() << "A category is empty";
return true;
}
}
- logDebug() << "No category empty" << endl;
+ logDebug() << "No category empty";
return false;
}
int MultipleFileList::categoryCount(int index) const {
QTreeWidgetItem* item = fileList->topLevelItem(index);
if (item==NULL) {
- logError() << "Index out of range" << index << endl;
+ logError() << "Index out of range" << index;
return 0;
}
}
void MultipleFileList::addItem(int category) {
- logDebug() << "Adding item" << category << endl;
+ logDebug() << "Adding item" << category;
//Open a standard Filedialog
KUrl::List urls=fileListHelper.openUrls();
}
void MultipleFileList::addItemInternal(QTreeWidgetItem* categoryItem, const QString& path) {
- logDebug() << "Adding" << path << "to" << categoryItem->text(0) << endl;
+ logDebug() << "Adding" << path << "to" << categoryItem->text(0);
QTreeWidgetItem* item = new QTreeWidgetItem(QStringList(path));
categoryItem->addChild(item);
categoryItem->setExpanded(true);
}
QTreeWidgetItem* MultipleFileList::findCategoryOfChild(QTreeWidgetItem* childItem) {
- logDebug() << "Finding Category of" << childItem->text(0) << endl;
+ logDebug() << "Finding Category of" << childItem->text(0);
for(int i=0; i<fileList->topLevelItemCount(); ++i) {
QTreeWidgetItem* item = fileList->topLevelItem(i);
if (item->indexOfChild(childItem) != -1) {
- logDebug() << "Category of" << childItem->text(0) << "is" << item->text(0) << endl;
+ logDebug() << "Category of" << childItem->text(0) << "is" << item->text(0);
return item;
}
}
- logDebug() << "No Category of" << childItem->text(0) << endl;
+ logDebug() << "No Category of" << childItem->text(0);
return NULL;
}
}
void MultipleFileList::updateEmptyItems() {
- logDebug() << "Updating empty items..." << endl;
+ logDebug() << "Updating empty items...";
- logDebug() << "Adding empty items..." << endl;
+ logDebug() << "Adding empty items...";
for(int i=0; i<fileList->topLevelItemCount(); ++i) {
QTreeWidgetItem* categoryItem = fileList->topLevelItem(i);
removeEmptyItems();
- logDebug() << "Empty items updated" << endl;
+ logDebug() << "Empty items updated";
}
void MultipleFileList::removeEmptyItems() {
- logDebug() << "Removing empty items..." << endl;
+ logDebug() << "Removing empty items...";
//Remove empty items of lists
for(int categoryIndex=0; categoryIndex<fileList->topLevelItemCount(); ++categoryIndex) {
QTreeWidgetItem* categoryItem = fileList->topLevelItem(categoryIndex);
- logDebug() << "Removing empty items of " << categoryItem->text(0) << endl;
+ logDebug() << "Removing empty items of " << categoryItem->text(0);
for(int i=0; i<categoryItem->childCount(); ++i) {
QTreeWidgetItem* childItem = categoryItem->child(i);
if (isEmptyItem(childItem) == true && categoryItem->childCount() > 1) {
- logDebug() << "Remove a child item" << endl;
+ logDebug() << "Remove a child item";
delete categoryItem->takeChild(i);
break;
}
}
- logDebug() << "Empty items of " << categoryItem->text(0) << "removed" << endl;
+ logDebug() << "Empty items of " << categoryItem->text(0) << "removed";
}
}
void MultipleFileList::addEmptyItem(QTreeWidgetItem* item) {
- logDebug() << "Adding an empty item..." << endl;
+ logDebug() << "Adding an empty item...";
QTreeWidgetItem* emptyItem = new QTreeWidgetItem(item, QStringList(i18n("No log file...")));
item->setExpanded(true);
int firstPosition = regex.indexIn(dateTime);
if (firstPosition == -1) {
- logDebug() << "Unable to parse date " << dateTime << endl;
+ logDebug() << "Unable to parse date " << dateTime;
return QDateTime::currentDateTime();
}
* TODO Improve speed of this method (with KRegExp class for example)
*/
LogLine* SyslogAnalyzer::parseMessage(const QString& logLine, const LogFile& originalFile) {
- //logDebug() << QTime::currentTime() << " : Reading line : " << logLine << " from " << originalFile.url.path() << endl;
+ //logDebug() << QTime::currentTime() << " : Reading line : " << logLine << " from " << originalFile.url.path();
//15 is the default date size format
if (logLine.length()<15) {
- logDebug() << "Too short line" << endl;
+ logDebug() << "Too short line";
return undefinedLogLine(logLine, originalFile);
}
QDateTime dateTime(QDate(year, monthNum, dayNum), QTime(h, m, s));
if (dateTime.isValid() == false) {
- logDebug() << "Malformed date and time" << endl;
+ logDebug() << "Malformed date and time";
return undefinedLogLine(logLine, originalFile);
}
bool isValid() const {
if (fileList->isEmpty() == true) {
- logDebug() << "Cron configuration not valid" << endl;
+ logDebug() << "Cron configuration not valid";
return false;
}
if (processFilterGroup->isChecked() && processFilter->text().isEmpty()) {
- logDebug() << "Cron configuration not valid" << endl;
+ logDebug() << "Cron configuration not valid";
return false;
}
- logDebug() << "Cron configuration valid" << endl;
+ logDebug() << "Cron configuration valid";
return true;
}
void saveConfig() {
- logDebug() << "Saving config from Cron Options..." << endl;
+ logDebug() << "Saving config from Cron Options...";
CronConfiguration* cronConfiguration = Globals::instance()->findLogMode(QLatin1String( CRON_LOG_MODE_ID ))->logModeConfiguration<CronConfiguration*>();
cronConfiguration->setCronPaths(fileList->paths());
int firstPosition = cupsAccessRegex.indexIn(logLine);
if (firstPosition == -1) {
- logDebug() << "Unable to parse line " << logLine << endl;
+ logDebug() << "Unable to parse line " << logLine;
return NULL;
}
return(*it);
}
else {
- logError() << i18n("New Log Level detected: Please send this log file to the KSystemLog developer to add it.") << endl;
+ logError() << i18n("New Log Level detected: Please send this log file to the KSystemLog developer to add it.");
return(Globals::instance()->noLogLevel());
}
}
public slots:
void saveConfig() {
- logDebug() << "Saving config from Cups Options..." << endl;
+ logDebug() << "Saving config from Cups Options...";
CupsConfiguration* cupsConfiguration = Globals::instance()->findLogMode(QLatin1String( CUPS_LOG_MODE_ID ))->logModeConfiguration<CupsConfiguration*>();
cupsConfiguration->setCupsPaths(cupsFileList->paths(cupsPathsId));
protected:
bool isValid() const {
if (cupsFileList->isOneOfCategoryEmpty()==true) {
- logDebug() << "Cups configuration not valid" << endl;
+ logDebug() << "Cups configuration not valid";
return false;
}
- logDebug() << "Cups configuration valid" << endl;
+ logDebug() << "Cups configuration valid";
return true;
}
int firstPosition = cupsPageRegex.indexIn(logLine);
if (firstPosition == -1) {
- logDebug() << "Unable to parse line " << logLine << endl;
+ logDebug() << "Unable to parse line " << logLine;
return NULL;
}
int firstPosition = cupsPdfRegex.indexIn(logLine);
if (firstPosition == -1) {
- logDebug() << "Unable to parse line " << logLine << endl;
+ logDebug() << "Unable to parse line " << logLine;
return NULL;
}
QStringList capturedTexts = cupsPdfRegex.capturedTexts();
/*
- logDebug() << "------------------------------------------" << endl;
+ logDebug() << "------------------------------------------";
foreach(QString cap, capturedTexts) {
- logDebug() << cap << endl;
+ logDebug() << cap;
}
- logDebug() << "------------------------------------------" << endl;
+ logDebug() << "------------------------------------------";
*/
//Remove full line
#include <QRegExp>
#include <QFile>
+#include <QTextStream>
#include <klocale.h>
long updateSeconds = pureSecondsString.toLong();
startupDateTime = QDateTime::currentDateTime().addSecs(- updateSeconds);
- logDebug() << "Startup time : " << startupDateTime << endl;
+ logDebug() << "Startup time : " << startupDateTime;
}
//If we have the date, we are able to update the start date
if (timeExists != -1) {
- //logDebug() << componentRegexp.cap(1).toInt() << "and" << componentRegexp.cap(2).toInt() << endl;
+ //logDebug() << componentRegexp.cap(1).toInt() << "and" << componentRegexp.cap(2).toInt();
dateTime = dateTime.addSecs( timeRegex.cap(1).toInt() );
dateTime = dateTime.addMSecs( timeRegex.cap(2).toInt()/1000 );
}
/*
- logDebug() << "--------------------------------" << endl;
- logDebug() << logLine << endl;
- logDebug() << "Secs : " << dateTime.time().second() << endl;
- logDebug() << "MSec : " << dateTime.time().msec() << endl;
- logDebug() << "Comp : " << messages.at(0) << endl;
- logDebug() << "Msg : " << messages.at(1) << endl;
- logDebug() << "--------------------------------" << endl;
+ logDebug() << "--------------------------------";
+ logDebug() << logLine;
+ logDebug() << "Secs : " << dateTime.time().second();
+ logDebug() << "MSec : " << dateTime.time().msec();
+ logDebug() << "Comp : " << messages.at(0);
+ logDebug() << "Msg : " << messages.at(1);
+ logDebug() << "--------------------------------";
*/
LogLine* line = new LogLine(
QList<LogFile> OpenLogMode::createLogFiles() {
//Open a standard Filedialog
KUrl openingFileName(KFileDialog::getOpenUrl(KUrl(), QString(), parent, i18n("Open Location")));
- logDebug() << "Opening file : " << openingFileName.url() << endl;
+ logDebug() << "Opening file : " << openingFileName.url();
if (openingFileName.isEmpty()) {
return QList<LogFile>();
items.append(message + "\n" + message);
- logDebug() << "Coucou" << items.at(items.count()-1) << endl;
+ logDebug() << "Coucou" << items.at(items.count()-1);
syslogLine->setLogItems(items);
return syslogLine;
bool isValid() const {
if (fileList->isEmpty() == false) {
- logDebug() << "Postfix configuration valid" << endl;
+ logDebug() << "Postfix configuration valid";
return true;
}
- logDebug() << "Postfix configuration not valid" << endl;
+ logDebug() << "Postfix configuration not valid";
return false;
}
void saveConfig() {
- logDebug() << "Saving config from Postfix Options..." << endl;
+ logDebug() << "Saving config from Postfix Options...";
PostfixConfiguration* configuration = Globals::instance()->findLogMode(QLatin1String( POSTFIX_LOG_MODE_ID ))->logModeConfiguration<PostfixConfiguration*>();
configuration->setLogFilesPaths(fileList->paths());
list.append(function);
list.append(lineNumber);
- logDebug() << "Creating new line " << endl;
+ logDebug() << "Creating new line ";
LogLine* returnedLogLine = currentLogLine;
public slots:
void saveConfig() {
- logDebug() << "Saving config from Samba Options..." << endl;
+ logDebug() << "Saving config from Samba Options...";
SambaConfiguration* sambaConfiguration = Globals::instance()->findLogMode(QLatin1String( SAMBA_LOG_MODE_ID ))->logModeConfiguration<SambaConfiguration*>();
sambaConfiguration->setSambaPaths(sambaFileList->paths(sambaPathsId));
protected:
bool isValid() const {
if (sambaFileList->isOneOfCategoryEmpty()==true) {
- logDebug() << "Samba configuration not valid" << endl;
+ logDebug() << "Samba configuration not valid";
return false;
}
- logDebug() << "Samba configuration valid" << endl;
+ logDebug() << "Samba configuration valid";
return true;
}
bool isValid() const {
if (fileList->isEmpty() == false) {
- logDebug() << "System configuration valid" << endl;
+ logDebug() << "System configuration valid";
return true;
}
- logDebug() << "System configuration not valid" << endl;
+ logDebug() << "System configuration not valid";
return false;
}
void saveConfig() {
- logDebug() << "Saving config from System Options..." << endl;
+ logDebug() << "Saving config from System Options...";
SystemConfiguration* systemConfiguration = Globals::instance()->findLogMode(QLatin1String( SYSTEM_LOG_MODE_ID ))->logModeConfiguration<SystemConfiguration*>();
systemConfiguration->setLogFilesPaths(fileList->paths());
//Delete existing tabs and related tabLogManagers
foreach(TabLogManager* tabLogManager, copy) {
- logDebug() << "Deleting " << tabLogManager->logManager()->logMode()->name() << endl;
+ logDebug() << "Deleting " << tabLogManager->logManager()->logMode()->name();
removePage(tabLogManager->logManager()->usedView());
d->tabLogManagers.removeAll(tabLogManager);
delete tabLogManager;
- logDebug() << tabLogManager->logManager()->logMode()->name() << " deleted" << endl;
+ logDebug() << tabLogManager->logManager()->logMode()->name() << " deleted";
}
*/
}
void TabLogViewsWidget::newTab(View* view) {
- logDebug() << "Inserting to a new tab the view " << endl;
+ logDebug() << "Inserting to a new tab the view ";
//Add a tab at the end of the widget
insertTab(count(), view, SmallIcon(QLatin1String( NO_MODE_ICON )), i18n("No Log"));
}
void TabLogViewsWidget::changeTab(View* view, const QIcon& icon, const QString& label) {
- logDebug() << "Changing tab " << label << endl;
+ logDebug() << "Changing tab " << label;
int index = indexOf(view);
setTabIcon(index, icon);
setTabText(index, label);
}
}
- logError() << "No log manager found" << endl;
+ logError() << "No log manager found";
return NULL;
}
}
LogManager* TabLogViewsWidget::createTab() {
- logDebug() << "Creating a new tab" << endl;
+ logDebug() << "Creating a new tab";
return newTabLogManager()->logManager();
}
void TabLogViewsWidget::moveTabLeft() {
- logDebug() << "Duplicate tab to the left" << endl;
+ logDebug() << "Duplicate tab to the left";
TabLogManager* currentTabLogManager=activeTabLogManager();
int position=indexOf(currentTabLogManager->logManager()->usedView());
if (position<=0) {
- logError() << "Tab Position <= 0 : " << position << endl;
+ logError() << "Tab Position <= 0 : " << position;
return;
}
}
void TabLogViewsWidget::moveTabRight() {
- logDebug() << "Duplicate tab to the right" << endl;
+ logDebug() << "Duplicate tab to the right";
TabLogManager* currentTabLogManager=activeTabLogManager();
int position=indexOf(currentTabLogManager->logManager()->usedView());
if (position>=count()-1) {
- logError() << "Tab Position >= count()-1 : " << position << endl;
+ logError() << "Tab Position >= count()-1 : " << position;
return;
}
}
LogManager* TabLogViewsWidget::duplicateTab() {
- logDebug() << "Duplicate current tab" << endl;
+ logDebug() << "Duplicate current tab";
TabLogManager* currentManager=activeTabLogManager();
}
TabLogManager* TabLogViewsWidget::newTabLogManager() {
- logDebug() << "Creating new View..." << endl;
+ logDebug() << "Creating new View...";
View* view = new View(this);
- logDebug() << "Creating new LogManager..." << endl;
+ logDebug() << "Creating new LogManager...";
LogManager* logManager=new LogManager(view);
TabLogManager* tabLogManager = new TabLogManager(logManager);
d->tabLogManagers.append(tabLogManager);
- logDebug() << "New LogManager created" << endl;
+ logDebug() << "New LogManager created";
//Finally add the view to the tabs
newTab(view);
void TabLogViewsWidget::closeTab() {
if (count()==1) {
- logError() << "Cannot close tab, one tab left" << endl;
+ logError() << "Cannot close tab, one tab left";
return;
}
}
void TabLogViewsWidget::load(LogMode* logMode, LogManager* manager) {
- logDebug() << "Loading a new mode : " << logMode->name() << endl;
+ logDebug() << "Loading a new mode : " << logMode->name();
if (manager==NULL || logMode==NULL) {
- logError() << "Error while loading a manager " << endl;
+ logError() << "Error while loading a manager";
return;
}
}
void TabLogViewsWidget::reloadCurrent() {
- logDebug() << "Reloading current log manager..." << endl;
+ logDebug() << "Reloading current log manager...";
LogManager* manager=activeLogManager();
}
void TabLogViewsWidget::reloadAll() {
- logDebug() << "Reloading all tabs..." << endl;
+ logDebug() << "Reloading all tabs...";
foreach (TabLogManager* tabLogManager, d->tabLogManagers) {
//Log manager without log mode does not need to be reloaded
}
void TabLogViewsWidget::changeCurrentTab() {
- logDebug() << "Changing current tab..." << endl;
+ logDebug() << "Changing current tab...";
TabLogManager* tabLogManager=activeTabLogManager();
//If the tab displayed the new added line count, rename it to the default log mode name
changeTab(tabLogManager->logManager()->usedView(), logModeIcon(tabLogManager->logManager()->logMode()), tabLogManager->title());
- logDebug() << "Current tab changed" << endl;
+ logDebug() << "Current tab changed";
}
void TabLogViewsWidget::changeReloadingTab(View* view, bool reloading) {
}
void TabLogViewsWidget::changeTitleAddedLines(View* view, int addedLinesSinceLastUpdate) {
- logDebug() << "Changing title" << addedLinesSinceLastUpdate << " added lines..." << endl;
+ logDebug() << "Changing title" << addedLinesSinceLastUpdate << " added lines...";
LogManager* currentManager=activeLogManager();
//Only display added line on tab title if this is not an update of the current tab
}
void TabLogViewsWidget::showContextMenu(const QPoint& cursorPosition) {
- logDebug() << "Showing context menu at " << cursorPosition << endl;
+ logDebug() << "Showing context menu at " << cursorPosition;
prepareContextMenu(false);
}
void TabLogViewsWidget::showContextMenu(QWidget* tab, const QPoint& cursorPosition) {
- logDebug() << "Showing context menu at " << cursorPosition << " at " << tab->objectName() << endl;
+ logDebug() << "Showing context menu at " << cursorPosition << " at " << tab->objectName();
prepareContextMenu(true);
existingMethods << QLatin1String("void SlaveBase::chown(KUrl const &, const QString &, const QString &)");
existingMethods << QLatin1String("void SlaveBase::setSubUrl(KUrl const &)");
- //logDebug() << existingMethods << endl;
+ //logDebug() << existingMethods;
QFile file(outputPath);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- logError() << "Unable to open the output file" << outputPath << endl;
+ logError() << "Unable to open the output file" << outputPath;
return;
}
}
- logDebug() << endl;
+ logDebug();
return foundMethods;
}
KIO::NetAccess::removeTempFile(tmpFile );
} else {
- logDebug() << KIO::NetAccess::lastErrorString() << endl;;
+ logDebug() << KIO::NetAccess::lastErrorString();
}
return kioHeaderContent;
void KioLogFileReaderTest::initTestCase() {
- logDebug() << "Hello" << endl;
+ logDebug() << "Hello";
}
}
void KioLogFileReaderTest::readLine(const QString& line) {
- logDebug() << "Line " << line << endl;
+ logDebug() << "Line " << line;
}
QTEST_KDEMAIN(KioLogFileReaderTest, GUI)
}
void SystemAnalyzerTest::compareWithMinTime(QList<LogLine*> logLines, const QDateTime& minTime) {
- logDebug() << "Min time : " << minTime.toString() << endl;
+ logDebug() << "Min time : " << minTime.toString();
foreach (LogLine* logLine, logLines) {
if (logLine->time() < minTime) {
}
void TestUtil::registerLogModeFactories() const {
- logDebug() << "Registering existing log mode factories" << endl;
+ logDebug() << "Registering existing log mode factories";
Globals::instance()->registerLogModeFactory(new SystemLogModeFactory());
Globals::instance()->registerLogModeFactory(new KernelLogModeFactory());
}
}
QList<LogFile> TestUtil::createLogFiles(const QString& resourceFileName) const {
- logDebug() << "Using log file name " << resourceFileName << endl;
+ logDebug() << "Using log file name " << resourceFileName;
LogLevel* informationLogLevel = Globals::instance()->informationLogLevel();
QFile data(fileName);
if (data.open(QFile::Append | QIODevice::Text)) {
- logDebug() << "Opening "<< fileName << " for writing " << addedLines.count() << " line(s)."<< endl;
+ logDebug() << "Opening "<< fileName << " for writing " << addedLines.count() << " line(s).";
QTextStream out(&data);
foreach (const QString &line, addedLines) {
}
void KvkbdApp::partLoaded(MainWidget *vPart, int total_rows, int total_cols)
{
- //cout << "Col Strech: " << total_cols << endl;
- // cout << "Row Strech: " << total_rows << endl;
+ // std::cout << "Col Strech: " << total_cols << std::endl;
+ // std::cout << "Row Strech: " << total_rows << std::endl;
QString partName = vPart->property("part").toString();
}
layout->addWidget(vPart,row_pos,col_pos,total_rows,total_cols);
- //cout << "Insert to layout: " << qPrintable(partName) << " RowStart: " << row_pos << " ColStart: " << col_pos << " RowSpan: " << total_rows << " ColSpan: " << total_cols << endl;
+ // std::cout << "Insert to layout: " << qPrintable(partName) << " RowStart: " << row_pos << " ColStart: " << col_pos << " RowSpan: " << total_rows << " ColSpan: " << total_cols << std::endl;
parts.insert(partName, vPart);
layoutPosition.insert(partName, QRect(col_pos,row_pos,total_cols,total_rows));
void ResizableDragWidget::mousePressEvent(QMouseEvent * ev)
{
-// cout << "ResizableDragWidget::mousePressEvent" << endl;
+ // std::cout << "ResizableDragWidget::mousePressEvent" << std::endl;
DragWidget::mousePressEvent(ev);
void ResizableDragWidget::mouseMoveEvent(QMouseEvent * ev)
{
-// cout << "ResizableDragWidget::mouseMoveEvent | Resize: " << doResize << " | Dragged: " << dragged << endl;
+ // std::cout << "ResizableDragWidget::mouseMoveEvent | Resize: " << doResize << " | Dragged: " << dragged << std::endl;
DragWidget::mouseMoveEvent(ev);
int width = node.attributes().namedItem("width").toAttr().value().toInt();
QString hintName = node.attributes().namedItem("name").toAttr().value();
widthMap.insert(hintName, width);
- //cout << "widths[" << qPrintable(hintName) << "]=>"<< width << endl;
+ // std::cout << "widths[" << qPrintable(hintName) << "]=>"<< width << std::endl;
}
wList = docElem.elementsByTagName("buttonHeight");
int height = node.attributes().namedItem("height").toAttr().value().toInt();
QString hintName = node.attributes().namedItem("name").toAttr().value();
heightMap.insert(hintName, height);
- //cout << "heights[" << qPrintable(hintName) << "]=>"<< height << endl;
+ // std::cout << "heights[" << qPrintable(hintName) << "]=>"<< height << std::endl;
}
wList = docElem.elementsByTagName("spacingHints");
int width = node.attributes().namedItem("width").toAttr().value().toInt();
QString hintName = node.attributes().namedItem("name").toAttr().value();
spacingMap.insert(hintName, width);
- //cout << "spacing[" << qPrintable(hintName) << "]=>"<< width << endl;
+ // std::cout << "spacing[" << qPrintable(hintName) << "]=>"<< width << std::endl;
}
wList = docElem.elementsByTagName("part");
btn->storeSize();
// btn->setNode(node);
- // cout << "ColorGroup: " << qPrintable(colorGroup) << endl;
+ // std::cout << "ColorGroup: " << qPrintable(colorGroup) << std::endl;
sx+=buttonWidth+rowSpacingX;
}
- //cout << "X=>"<<sx<<" | Y=>"<<sy<<endl;
+ //std::cout << "X=>"<<sx<<" | Y=>"<<sy<<endl;
//
}//row
#include <qtransform.h>
#include <qstring.h>
#include <qdom.h>
+#include <qcolor.h>
+#include <qpixmap.h>
// local includes
#include "global.h"
#include "area.h"
-#include <QColor>
-
namespace Okular {
class Action;
QString filename_test(font_pool->getExtraSearchPath() + '/' + filename);
file = fopen( QFile::encodeName(filename_test), "r");
if (file == 0) {
- kError(kvs::dvi) << i18n("Cannot find font %1, file %2.", fontname, filename) << endl;
+ kError(kvs::dvi) << i18n("Cannot find font %1, file %2.", fontname, filename);
return;
} else
filename = filename_test;
#else
// If we don't have the FreeType library, we should never have
// reached this point. Complain, and leave this font blank
- kError(kvs::dvi) << i18n("Cannot recognize format for font file %1", filename) << endl;
+ kError(kvs::dvi) << i18n("Cannot recognize format for font file %1", filename);
#endif
}
if ( error == FT_Err_Unknown_File_Format ) {
errorMessage = i18n("The font file %1 could be opened and read, but its font format is unsupported.", parent->filename);
- kError(kvs::dvi) << errorMessage << endl;
+ kError(kvs::dvi) << errorMessage;
fatalErrorInFontLoading = true;
return;
} else
if ( error ) {
errorMessage = i18n("The font file %1 is broken, or it could not be opened or read.", parent->filename);
- kError(kvs::dvi) << errorMessage << endl;
+ kError(kvs::dvi) << errorMessage;
fatalErrorInFontLoading = true;
return;
}
if ((found == 0) && (face->charmap != 0)) {
#ifdef DEBUG_PFB
kDebug(kvs::dvi) << "No encoding given: using charmap platform=" << face->charmap->platform_id <<
- ", encoding=" << face->charmap->encoding_id << " that is contained in the font." << endl;
+ ", encoding=" << face->charmap->encoding_id << " that is contained in the font.";
#endif
for(int i=0; i<256; i++)
charMap[i] = FT_Get_Char_Index( face, i );
// Paranoia checks
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
- kError(kvs::dvi) << "TeXFont_PFB::getGlyph(): Argument is too big." << endl;
+ kError(kvs::dvi) << "TeXFont_PFB::getGlyph(): Argument is too big.";
return glyphtable;
}
QString msg = i18n("FreeType reported an error when setting the character size for font file %1.", parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
- kError(kvs::dvi) << msg << endl;
+ kError(kvs::dvi) << msg;
g->shrunkenCharacter = QImage(1, 1, QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 255, 255));
return g;
QString msg = i18n("FreeType is unable to load glyph #%1 from font file %2.", ch, parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
- kError(kvs::dvi) << msg << endl;
+ kError(kvs::dvi) << msg;
g->shrunkenCharacter = QImage(1, 1, QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 255, 255));
return g;
QString msg = i18n("FreeType is unable to render glyph #%1 from font file %2.", ch, parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
- kError(kvs::dvi) << msg << endl;
+ kError(kvs::dvi) << msg;
g->shrunkenCharacter = QImage(1, 1, QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 255, 255));
return g;
if ((slot->bitmap.width == 0) || (slot->bitmap.rows == 0)) {
if (errorMessage.isEmpty())
errorMessage = i18n("Glyph #%1 is empty.", ch);
- kError(kvs::dvi) << i18n("Glyph #%1 from font file %2 is empty.", ch, parent->filename) << endl;
+ kError(kvs::dvi) << i18n("Glyph #%1 from font file %2 is empty.", ch, parent->filename);
g->shrunkenCharacter = QImage(15, 15 , QImage::Format_RGB32);
g->shrunkenCharacter.fill(qRgb(255, 0, 0));
g->x2 = 0;
QString msg = i18n("FreeType is unable to load metric for glyph #%1 from font file %2.", ch, parent->filename);
if (errorMessage.isEmpty())
errorMessage = msg;
- kError(kvs::dvi) << msg << endl;
+ kError(kvs::dvi) << msg;
g->dvi_advance_in_units_of_design_size_by_2e20 = 1;
}
g->dvi_advance_in_units_of_design_size_by_2e20 = (qint32)(((qint64)(1<<20) * (qint64)face->glyph->metrics.horiAdvance) / (qint64)face->units_per_EM);
characterBitmaps[i] = 0;
file = fopen(QFile::encodeName(parent->filename), "r");
if (file == 0)
- kError(kvs::dvi) << i18n("Cannot open font file %1.", parent->filename) << endl;
+ kError(kvs::dvi) << i18n("Cannot open font file %1.", parent->filename);
#ifdef DEBUG_PK
else
kDebug(kvs::dvi) << "TeXFont_PK::TeXFont_PK(): file opened successfully";
// Paranoia checks
if (ch >= TeXFontDefinition::max_num_of_chars_in_font) {
- kError(kvs::dvi) << "TeXFont_PK::getGlyph(): Argument is too big." << endl;
+ kError(kvs::dvi) << "TeXFont_PK::getGlyph(): Argument is too big.";
return glyphtable;
}
// If the character is not defined in the PK file, mark the
// character as missing, and print an error message
if (g->addr == 0) {
- kError(kvs::dvi) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2", ch, parent->filename) << endl;
+ kError(kvs::dvi) << i18n("TexFont_PK::operator[]: Character %1 not defined in font %2", ch, parent->filename);
g->addr = -1;
return g;
}
#endif
if (file == 0) {
- kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file == 0" << endl;
+ kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file == 0";
return;
}
int magic = two(file);
if (magic != PK_MAGIC) {
- kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file is not a PK file" << endl;
+ kError(kvs::dvi) << "TeXFont_PK::read_PK_index(): file is not a PK file";
return;
}
QFile file( parent->filename );
if ( !file.open( QIODevice::ReadOnly ) ) {
- kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file" << endl;
+ kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM(): Could not read TFM file";
return;
}
QDataStream stream( &file );
stream >> lf >> lh >> bc >> ec >> nw >> nh >> nd;
#ifdef DEBUG_TFM
kDebug(kvs::dvi) << "lf= " << lf
- << "lh= " << lh << endl
- << "bc= " << bc << endl
- << "ec= " << ec << endl
- << "nw= " << nw << endl
- << "nh= " << nh << endl
- << "nd= " << nd << endl;
+ << "lh= " << lh << '\n'
+ << "bc= " << bc << '\n'
+ << "ec= " << ec << '\n'
+ << "nw= " << nw << '\n'
+ << "nh= " << nh << '\n'
+ << "nd= " << nd;
#endif
if ((bc > ec) || (ec >= TeXFontDefinition::max_num_of_chars_in_font)) {
- kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid bc and ec entries." << endl;
+ kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid bc and ec entries.";
file.close();
return;
}
stream >> checksum >> design_size_in_TeX_points.value;
#ifdef DEBUG_TFM
kDebug(kvs::dvi) << "checksum = " << checksum
- << "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << endl
- << " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm" << endl;
+ << "design_size = " << design_size_in_TeX_points.toDouble() << " TeX Points" << '\n'
+ << " = " << design_size_in_TeX_points.toDouble()*254.0/7227.0 << " cm";
#endif
// Width table
quint8 byte;
stream >> byte;
if (byte >= nw)
- kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
+ kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table.";
else {
characterWidth_in_units_of_design_size[characterCode] = widthTable_in_units_of_design_size[byte];
g->dvi_advance_in_units_of_design_size_by_2e20 = widthTable_in_units_of_design_size[byte].value;
stream >> byte;
byte = byte >> 4;
if (byte >= nh)
- kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table." << endl;
+ kError(kvs::dvi) << "TeXFont_TFM::TeXFont_TFM( filename=" << parent->filename << " ): The font has an invalid Char-Info table.";
else
characterHeight_in_units_of_design_size[characterCode] = heightTable_in_units_of_design_size[byte];
// Paranoia checks
if (characterCode >= TeXFontDefinition::max_num_of_chars_in_font) {
- kError(kvs::dvi) << "TeXFont_TFM::getGlyph(): Argument is too big." << endl;
+ kError(kvs::dvi) << "TeXFont_TFM::getGlyph(): Argument is too big.";
return glyphtable;
}
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer) {
#ifdef DEBUG_ENDIANREADER
- kError(kvs::dvi) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk" << endl;
- kError(kvs::dvi) << "end_pointer = " << end_pointer << endl;
- kError(kvs::dvi) << "command_pointer = " << command_pointer << endl;
+ kError(kvs::dvi) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk";
+ kError(kvs::dvi) << "end_pointer = " << end_pointer;
+ kError(kvs::dvi) << "command_pointer = " << command_pointer;
#endif
return EOP;
}
size_of_file = old->size_of_file;
end_pointer = dvi_Data()+size_of_file;
if (dvi_Data() == 0) {
- kError(kvs::dvi) << "Not enough memory to copy the DVI-file." << endl;
+ kError(kvs::dvi) << "Not enough memory to copy the DVI-file.";
return;
}
page_offset.resize(total_pages+1);
if (page_offset.size() < (total_pages+1)) {
- kError(kvs::dvi) << "No memory for page list!" << endl;
+ kError(kvs::dvi) << "No memory for page list!";
return;
}
for(int i=0; i<=total_pages; i++)
// Paranoid safety checks
if (page == 0) {
- kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called with argument == 0" << endl;
+ kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called with argument == 0";
return;
}
// Paranoid safety checks
if (page->pageNumber == 0) {
- kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0" << endl;
+ kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number 0";
return;
}
if ( dviFile == 0 ) {
- kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated." << endl;
+ kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile class allocated.";
page->clear();
return;
}
if (page->pageNumber > dviFile->total_pages) {
kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called for a documentPage with page number " << page->pageNumber
- << " but the current dviFile has only " << dviFile->total_pages << " pages." << endl;
+ << " but the current dviFile has only " << dviFile->total_pages << " pages.";
return;
}
if ( dviFile->dvi_Data() == 0 ) {
- kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet." << endl;
+ kError(kvs::dvi) << "dviRenderer::drawPage(documentPage *) called, but no dviFile is loaded yet.";
page->clear();
return;
}
QMutexLocker locker(&mutex);
#ifdef DEBUG_DVIRENDERER
- kError(kvs::dvi) << "dviRenderer::parseReference( " << reference << " ) called" << endl;
+ kError(kvs::dvi) << "dviRenderer::parseReference( " << reference << " ) called";
#endif
if (dviFile == 0)
static unsigned char c;
macro *m = &currinf.fontp->macrotable[ch];
if (m->pos == NULL) {
- kError(kvs::dvi) << "Character " << ch << " not defined in font " << currinf.fontp->fontname << endl;
+ kError(kvs::dvi) << "Character " << ch << " not defined in font " << currinf.fontp->fontname;
m->pos = m->end = &c;
return;
}
QIODevice::ReadOnly|QIODevice::Text);
if (!kpsewhich.waitForStarted()) {
- kError(kvs::dvi) << "fontEncoding::fontEncoding(...): kpsewhich could not be started." << endl;
+ kError(kvs::dvi) << "fontEncoding::fontEncoding(...): kpsewhich could not be started.";
return;
}
const QString encFileName = QString(kpsewhich.readAll()).trimmed();
if (encFileName.isEmpty()) {
- kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName) << endl;
+ kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be found by kpsewhich.").arg(encName);
return;
}
for(; i<256; i++)
glyphNameVector[i] = ".notdef";
} else {
- kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName) << endl;
+ kError(kvs::dvi) << QString("fontEncoding::fontEncoding(...): The file '%1' could not be opened.").arg(encFileName);
return;
}
QIODevice::ReadOnly|QIODevice::Text);
if (!kpsewhich.waitForStarted()) {
- kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
+ kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started.";
return;
}
QStringList() << "--format=dvips config" << "ps2pk.map",
QIODevice::ReadOnly|QIODevice::Text);
if (!kpsewhich.waitForStarted()) {
- kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started." << endl;
+ kError(kvs::dvi) << "fontMap::fontMap(): kpsewhich could not be started.";
return;
}
map_fileName = QString(kpsewhich.readAll()).trimmed();
// If both versions fail, then there is nothing left to do.
if (map_fileName.isEmpty()) {
- kError(kvs::dvi) << "fontMap::fontMap(): The file 'ps2pk.map' could not be found by kpsewhich." << endl;
+ kError(kvs::dvi) << "fontMap::fontMap(): The file 'ps2pk.map' could not be found by kpsewhich.";
return;
}
}
}
file.close();
} else
- kError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName) << endl;
+ kError(kvs::dvi) << QString("fontMap::fontMap(): The file '%1' could not be opened.").arg(map_fileName);
#ifdef DEBUG_FONTMAP
kDebug(kvs::dvi) << "FontMap file parsed. Results:";
<< ", FontFileName=" << it.data().fontFileName
<< ", FullName=" << it.data().fullFontName
<< ", Encoding=" << it.data().fontEncoding
- << "." << endl;;
+ << ".";
#endif
}
#ifdef HAVE_FREETYPE
// Initialize the Freetype Library
if ( FT_Init_FreeType( &FreeType_library ) != 0 ) {
- kError(kvs::dvi) << "Cannot load the FreeType library. KDVI proceeds without FreeType support." << endl;
+ kError(kvs::dvi) << "Cannot load the FreeType library. KDVI proceeds without FreeType support.";
FreeType_could_be_loaded = false;
} else
FreeType_could_be_loaded = true;
#if 0
kDebug(DviDebug) << *request
<< ", res:" << pageInfo->resolution << " - (" << pageInfo->width << ","
- << ps.width().getLength_in_inch() << ")," << ps.width().getLength_in_mm()
- << endl;
+ << ps.width().getLength_in_inch() << ")," << ps.width().getLength_in_mm();
#endif
m_dviRenderer->drawPage( pageInfo );
kDebug(DviDebug) << "orientation: " << orientation
<< ", curTB.box: " << curTB.box
<< ", tmpRect: " << tmpRect
- << ", ( " << pageWidth << "," << pageHeight << " )"
- <<endl;
+ << ", ( " << pageWidth << "," << pageHeight << " )";
#endif
textOfThePage.push_back( new Okular::TextEntity( curTB.text,
new Okular::NormalizedRect( curTB.box, pageWidth, pageHeight ) ) );
// If no unit has been found -> error message, set *ok to false and
// return 0.0.
if (MMperUnit == 0.0) {
- kError(kvs::shell) << "distance::convertToMM: no known unit found in the string '" << distance << "'." << endl;
+ kError(kvs::shell) << "distance::convertToMM: no known unit found in the string '" << distance << "'.";
if (ok)
*ok = false;
return 0.0;
currentSize = defaultPageSize();
pageWidth.setLength_in_mm(staticList[currentSize].width);
pageHeight.setLength_in_mm(staticList[currentSize].height);
- kError(kvs::shell) << "pageSize::setPageSize: could not parse '" << name << "'. Using " << staticList[currentSize].name << " as a default." << endl;
+ kError(kvs::shell) << "pageSize::setPageSize: could not parse '" << name << "'. Using " << staticList[currentSize].name << " as a default.";
emit(sizeChanged(*this));
return false;
}
QString widthUnits = _widthUnits;
if ((widthUnits != "cm") && (widthUnits != "mm") && (widthUnits != "in")) {
- kError(kvs::shell) << "Unrecognized page width unit '" << widthUnits << "'. Assuming mm" << endl;
+ kError(kvs::shell) << "Unrecognized page width unit '" << widthUnits << "'. Assuming mm";
widthUnits = "mm";
}
pageWidth.setLength_in_mm(w);
QString heightUnits = _heightUnits;
if ((heightUnits != "cm") && (heightUnits != "mm") && (heightUnits != "in")) {
- kError(kvs::shell) << "Unrecognized page height unit '" << widthUnits << "'. Assuming mm" << endl;
+ kError(kvs::shell) << "Unrecognized page height unit '" << widthUnits << "'. Assuming mm";
heightUnits = "mm";
}
pageHeight.setLength_in_mm(h);
int pageSize::getOrientation() const
{
if (currentSize == -1) {
- kError(kvs::shell) << "pageSize::getOrientation: getOrientation called for page format that does not have a name." << endl;
+ kError(kvs::shell) << "pageSize::getOrientation: getOrientation called for page format that does not have a name.";
return 0;
}
void pageSize::setOrientation(int orient)
{
if (currentSize == -1) {
- kError(kvs::shell) << "pageSize::setOrientation: setOrientation called for page format that does not have a name." << endl;
+ kError(kvs::shell) << "pageSize::setOrientation: setOrientation called for page format that does not have a name.";
return;
}
#endif
if (knownDevices.isEmpty()) {
- kError(kvs::dvi) << "No known devices found" << endl;
+ kError(kvs::dvi) << "No known devices found";
return;
}
if ( res ) {
// Starting ghostscript did not work.
// TODO: Issue error message, switch PS support off.
- kError(kvs::dvi) << "ghostview could not be started" << endl;
+ kError(kvs::dvi) << "ghostview could not be started";
}
PSfile.remove();
// Check if gs has indeed produced a file.
if (QFile::exists(filename) == false) {
- kError(kvs::dvi) << "GS did not produce output." << endl;
+ kError(kvs::dvi) << "GS did not produce output.";
// No. Check is the reason is that the device is not compiled into
// ghostscript. If so, try again with another device.
GSoutput = QString::fromLocal8Bit(proc.readLine());
if (GSoutput.contains("Unknown device")) {
kDebug(kvs::dvi) << QString("The version of ghostview installed on this computer does not support "
- "the '%1' ghostview device driver.").arg(*gsDevice) << endl;
+ "the '%1' ghostview device driver.").arg(*gsDevice);
knownDevices.erase(gsDevice);
gsDevice = knownDevices.begin();
if (knownDevices.isEmpty())
#endif
if (paint == 0) {
- kError(kvs::dvi) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0" << endl;
+ kError(kvs::dvi) << "ghostscript_interface::graphics(PageNumber page, double dpi, long magnification, QPainter *paint) called with paint == 0";
return;
}
double SimplePageSize::zoomForHeight(quint32 height, const QPaintDevice& pd) const
{
if (!isValid()) {
- kError(kvs::shell) << "SimplePageSize::zoomForHeight() called when paper height was invalid" << endl;
+ kError(kvs::shell) << "SimplePageSize::zoomForHeight() called when paper height was invalid";
return 0.1;
}
double SimplePageSize::zoomForWidth(quint32 width, const QPaintDevice& pd) const
{
if (!isValid()) {
- kError(kvs::shell) << "SimplePageSize::zoomForWidth() called when paper width was invalid" << endl;
+ kError(kvs::shell) << "SimplePageSize::zoomForWidth() called when paper width was invalid";
return 0.1;
}
void dviRenderer::printErrorMsgForSpecials(const QString& msg)
{
if (dviFile->errorCounter < 25) {
- kError(kvs::dvi) << msg << endl;
+ kError(kvs::dvi) << msg;
dviFile->errorCounter++;
if (dviFile->errorCounter == 25)
- kError(kvs::dvi) << i18n("That makes 25 errors. Further error messages will not be printed.") << endl;
+ kError(kvs::dvi) << i18n("That makes 25 errors. Further error messages will not be printed.");
}
}
// Maybe we should open a dialog here.
kError(kvs::dvi) << i18n("Malformed parameter in the epsf special command.\n"
"Expected a float to follow %1 in %2",
- argument_name, strg) << endl;
+ argument_name, strg);
}
}
void oops(const QString& message)
{
- kError(kvs::dvi) << "Fatal Error:" << message << endl;
+ kError(kvs::dvi) << "Fatal Error:" << message;
KMessageBox::error( NULL,
i18n("Fatal error.\n\n") +
if (file_checksum && checksum && file_checksum != checksum)
kError(kvs::dvi) << "Checksum mismatch dvi = " << checksum << "u, vf = " << file_checksum <<
- "u) in font file" << filename << endl;
+ "u) in font file" << filename;
(void) four(VF_file); /* skip design size */
// Read the fonts.
{
if (verbose)
kError() << "Line " << LineNum << ": Unexpected state in "
- << what << endl;
+ << what;
}
/* Expand tiff modified huffman data (g3-1d without EOLs) */
synopsisElement.setAttribute( "Viewport", viewport.toString() );
if ( outlineLevel == 1 ) {
// kDebug(XpsDebug) << "Description: "
- // << outlineEntryElement.attribute( "Description" ) << endl;
+ // << outlineEntryElement.attribute( "Description" );
m_docStructure->appendChild( synopsisElement );
} else {
// find the last next highest element (so it this is level 3, we need
} else {
kDebug(XpsDebug) << "Unknown document relationships element: "
<< attributes.value( "Type" ).toString() << " : "
- << attributes.value( "Target" ).toString() << endl;
+ << attributes.value( "Target" ).toString();
}
}
}
if ( xml.error() ) {
kDebug(XpsDebug) << "Could not parse XPS page relationships file ( "
<< documentRelationshipFile
- << " ) - " << xml.errorString() << endl;
+ << " ) - " << xml.errorString();
}
} else { // the page relationship file didn't exist in the zipfile
// this isn't fatal
#include <QFont>
#include <QtGui/qevent.h>
#include <QFile>
+#include <QTextStream>
#include <kapplication.h>
#include <kdebug.h>