summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/notation
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/editors/notation')
-rw-r--r--src/gui/editors/notation/NotationCanvasView.cpp4
-rw-r--r--src/gui/editors/notation/NotationElement.cpp2
-rw-r--r--src/gui/editors/notation/NotationSelector.cpp2
-rw-r--r--src/gui/editors/notation/NotationStaff.cpp2
-rw-r--r--src/gui/editors/notation/NotationVLayout.cpp2
-rw-r--r--src/gui/editors/notation/NotationView.cpp68
-rw-r--r--src/gui/editors/notation/NoteFontFactory.cpp2
-rw-r--r--src/gui/editors/notation/NoteFontMap.cpp92
-rw-r--r--src/gui/editors/notation/NoteInserter.cpp8
-rw-r--r--src/gui/editors/notation/NotePixmapFactory.cpp4
-rw-r--r--src/gui/editors/notation/NoteStyleFactory.cpp2
-rw-r--r--src/gui/editors/notation/NoteStyleFileReader.cpp18
-rw-r--r--src/gui/editors/notation/RestInserter.cpp6
13 files changed, 106 insertions, 106 deletions
diff --git a/src/gui/editors/notation/NotationCanvasView.cpp b/src/gui/editors/notation/NotationCanvasView.cpp
index a80d04d..7e7f4c9 100644
--- a/src/gui/editors/notation/NotationCanvasView.cpp
+++ b/src/gui/editors/notation/NotationCanvasView.cpp
@@ -186,7 +186,7 @@ void NotationCanvasView::contentsMousePressEvent(TQMouseEvent *e)
for (it = itemList.begin(); it != itemList.end(); ++it) {
- if ((*it)->active()) {
+ if ((*it)->isActive()) {
emit activeItemPressed(e, *it);
return ;
}
@@ -284,7 +284,7 @@ NotationCanvasView::processActiveItems(TQMouseEvent* e,
for (it = itemList.begin(); it != itemList.end(); ++it) {
TQCanvasItem *item = *it;
- if (item->active() && !pressedItem) {
+ if (item->isActive() && !pressedItem) {
NOTATION_DEBUG << "mousepress : got active item\n";
pressedItem = item;
}
diff --git a/src/gui/editors/notation/NotationElement.cpp b/src/gui/editors/notation/NotationElement.cpp
index c23ebd6..5fa715f 100644
--- a/src/gui/editors/notation/NotationElement.cpp
+++ b/src/gui/editors/notation/NotationElement.cpp
@@ -184,7 +184,7 @@ NotationElement::reposition(double canvasX, double canvasY)
bool
NotationElement::isSelected()
{
- return m_canvasItem ? m_canvasItem->selected() : false;
+ return m_canvasItem ? m_canvasItem->isSelected() : false;
}
void
diff --git a/src/gui/editors/notation/NotationSelector.cpp b/src/gui/editors/notation/NotationSelector.cpp
index 6c6b04f..26114fe 100644
--- a/src/gui/editors/notation/NotationSelector.cpp
+++ b/src/gui/editors/notation/NotationSelector.cpp
@@ -824,7 +824,7 @@ EventSelection* NotationSelector::getSelection()
// If selection rect is not visible or too small,
// return 0
//
- if (!m_selectionRect->visible()) return 0;
+ if (!m_selectionRect->isVisible()) return 0;
// NOTATION_DEBUG << "Selection x,y: " << m_selectionRect->x() << ","
// << m_selectionRect->y() << "; w,h: " << m_selectionRect->width() << "," << m_selectionRect->height() << endl;
diff --git a/src/gui/editors/notation/NotationStaff.cpp b/src/gui/editors/notation/NotationStaff.cpp
index 729eddb..83575c6 100644
--- a/src/gui/editors/notation/NotationStaff.cpp
+++ b/src/gui/editors/notation/NotationStaff.cpp
@@ -935,7 +935,7 @@ NotationStaff::renderSingleElement(ViewElementList::iterator &vli,
static bool warned = false;
if (!warned) {
- KMessageBox::error(0, i18n(strtoqstr(u.getMessage())));
+ KMessageBox::error(0, i18n(strtoqstr(u.getMessage()).ascii()));
warned = true;
}
}
diff --git a/src/gui/editors/notation/NotationVLayout.cpp b/src/gui/editors/notation/NotationVLayout.cpp
index 55f4d76..af6a2fe 100644
--- a/src/gui/editors/notation/NotationVLayout.cpp
+++ b/src/gui/editors/notation/NotationVLayout.cpp
@@ -236,7 +236,7 @@ NotationVLayout::scanStaff(Staff &staffBase, timeT, timeT)
if (!(*chord[j])->event()->get
<Int>
(m_properties.HEIGHT_ON_STAFF, height)) {
- std::cerr << TQString("ERROR: Event in chord at %1 has no HEIGHT_ON_STAFF property!\nThis is a bug (the program would previously have crashed by now)").tqarg((*chord[j])->getViewAbsoluteTime()) << std::endl;
+ std::cerr << TQString("ERROR: Event in chord at %1 has no HEIGHT_ON_STAFF property!\nThis is a bug (the program would previously have crashed by now)").tqarg((*chord[j])->getViewAbsoluteTime()).ascii() << std::endl;
(*chord[j])->event()->dump(std::cerr);
}
h.push_back(height);
diff --git a/src/gui/editors/notation/NotationView.cpp b/src/gui/editors/notation/NotationView.cpp
index 0a471d5..bd553ee 100644
--- a/src/gui/editors/notation/NotationView.cpp
+++ b/src/gui/editors/notation/NotationView.cpp
@@ -1527,7 +1527,7 @@ void NotationView::setupActions()
KToggleAction *fontAction =
new KToggleAction
(fontTQName, 0, TQT_TQOBJECT(this), TQT_SLOT(slotChangeFontFromAction()),
- actionCollection(), "note_font_" + fontTQName);
+ actionCollection(), TQString("note_font_" + fontTQName).ascii());
fontAction->setChecked(*i == m_fontName);
fontActionMenu->insert(fontAction);
@@ -1559,7 +1559,7 @@ void NotationView::setupActions()
new KToggleAction
(TQString("%1%").tqarg(*i), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotChangeSpacingFromAction()),
- actionCollection(), TQString("spacing_%1").tqarg(*i));
+ actionCollection(), TQString("spacing_%1").tqarg(*i).ascii());
spacingAction->setExclusiveGroup("spacing");
spacingAction->setChecked(*i == defaultSpacing);
@@ -1585,7 +1585,7 @@ void NotationView::setupActions()
new KToggleAction
(name, 0, TQT_TQOBJECT(this),
TQT_SLOT(slotChangeProportionFromAction()),
- actionCollection(), TQString("proportion_%1").tqarg(*i));
+ actionCollection(), TQString("proportion_%1").tqarg(*i).ascii());
proportionAction->setExclusiveGroup("proportion");
proportionAction->setChecked(*i == defaultProportion);
@@ -1608,7 +1608,7 @@ void NotationView::setupActions()
KAction *styleAction =
new KAction
(styleTQName, 0, TQT_TQOBJECT(this), TQT_SLOT(slotSetStyleFromAction()),
- actionCollection(), "style_" + styleTQName);
+ actionCollection(), TQString("style_" + styleTQName).ascii());
styleActionMenu->insert(styleAction);
}
@@ -1622,17 +1622,17 @@ void NotationView::setupActions()
new KAction
(i18n("Insert Rest"), Key_P, TQT_TQOBJECT(this), TQT_SLOT(slotInsertRest()),
- actionCollection(), TQString("insert_rest"));
+ actionCollection(), TQString("insert_rest").ascii());
new KAction
(i18n("Switch from Note to Rest"), Key_T, TQT_TQOBJECT(this),
TQT_SLOT(slotSwitchFromNoteToRest()),
- actionCollection(), TQString("switch_from_note_to_rest"));
+ actionCollection(), TQString("switch_from_note_to_rest").ascii());
new KAction
(i18n("Switch from Rest to Note"), Key_Y, TQT_TQOBJECT(this),
TQT_SLOT(slotSwitchFromRestToNote()),
- actionCollection(), TQString("switch_from_rest_to_note"));
+ actionCollection(), TQString("switch_from_rest_to_note").ascii());
// setup Notes menu & toolbar
@@ -1646,14 +1646,14 @@ void NotationView::setupActions()
icon = TQIconSet
(NotePixmapFactory::toTQPixmap(NotePixmapFactory::makeToolbarPixmap
- (noteActionData.pixmapName)));
+ (noteActionData.pixmapName.ascii())));
noteAction = new KRadioAction(noteActionData.title,
icon,
noteActionData.keycode,
TQT_TQOBJECT(this),
TQT_SLOT(slotNoteAction()),
actionCollection(),
- noteActionData.actionName);
+ noteActionData.actionName.ascii());
noteAction->setExclusiveGroup("notes");
if (noteActionData.noteType == Note::Crotchet &&
@@ -1671,7 +1671,7 @@ void NotationView::setupActions()
icon = TQIconSet
(NotePixmapFactory::toTQPixmap(NotePixmapFactory::makeToolbarPixmap
- (data.pixmapName)));
+ (data.pixmapName.ascii())));
KAction *action = new KAction(data.title,
icon,
@@ -1679,7 +1679,7 @@ void NotationView::setupActions()
TQT_TQOBJECT(this),
TQT_SLOT(slotNoteChangeAction()),
actionCollection(),
- data.actionName);
+ data.actionName.ascii());
}
//
@@ -1700,10 +1700,10 @@ void NotationView::setupActions()
i < sizeof(actionsAccidental) / sizeof(actionsAccidental[0]); ++i) {
icon = TQIconSet(NotePixmapFactory::toTQPixmap(NotePixmapFactory::makeToolbarPixmap
- (actionsAccidental[i][3])));
+ (actionsAccidental[i][3].ascii())));
noteAction = new KRadioAction(actionsAccidental[i][0], icon, 0, TQT_TQOBJECT(this),
- actionsAccidental[i][1],
- actionCollection(), actionsAccidental[i][2]);
+ actionsAccidental[i][1].ascii(),
+ actionCollection(), actionsAccidental[i][2].ascii());
noteAction->setExclusiveGroup("accidentals");
}
@@ -2194,7 +2194,7 @@ void NotationView::setupActions()
TQT_TQOBJECT(this),
TQT_SLOT(slotAddMark()),
actionCollection(),
- markActionData.actionName);
+ markActionData.actionName.ascii());
}
icon = TQIconSet
@@ -2263,7 +2263,7 @@ void NotationView::setupActions()
for (int i = 0; i <= 5; ++i) {
new KAction(slashTitles[i], 0, TQT_TQOBJECT(this),
TQT_SLOT(slotAddSlashes()), actionCollection(),
- TQString("slashes_%1").tqarg(i));
+ TQString("slashes_%1").tqarg(i).ascii());
}
new KAction(ClefInsertionCommand::getGlobalName(), 0, TQT_TQOBJECT(this),
@@ -2315,11 +2315,11 @@ void NotationView::setupActions()
for (unsigned int i = 0;
i < sizeof(actionsToolbars) / sizeof(actionsToolbars[0]); ++i) {
- icon = TQIconSet(NotePixmapFactory::toTQPixmap(NotePixmapFactory::makeToolbarPixmap(actionsToolbars[i][3])));
+ icon = TQIconSet(NotePixmapFactory::toTQPixmap(NotePixmapFactory::makeToolbarPixmap(actionsToolbars[i][3].ascii())));
new KToggleAction(actionsToolbars[i][0], icon, 0,
- TQT_TQOBJECT(this), actionsToolbars[i][1],
- actionCollection(), actionsToolbars[i][2]);
+ TQT_TQOBJECT(this), actionsToolbars[i][1].ascii(),
+ actionCollection(), actionsToolbars[i][2].ascii());
}
new KAction(i18n("Cursor &Back"), 0, Key_Left, TQT_TQOBJECT(this),
@@ -2546,7 +2546,7 @@ NotationView::setupFontSizeMenu(std::string oldFontName)
for (unsigned int i = 0; i < sizes.size(); ++i) {
KAction *action =
actionCollection()->action
- (TQString("note_font_size_%1").tqarg(sizes[i]));
+ (TQString("note_font_size_%1").tqarg(sizes[i]).ascii());
m_fontSizeActionMenu->remove
(action);
@@ -2563,14 +2563,14 @@ NotationView::setupFontSizeMenu(std::string oldFontName)
TQString actionName = TQString("note_font_size_%1").tqarg(sizes[i]);
KToggleAction *sizeAction = dynamic_cast<KToggleAction *>
- (actionCollection()->action(actionName));
+ (actionCollection()->action(actionName.ascii()));
if (!sizeAction) {
sizeAction =
new KToggleAction(i18n("1 pixel", "%n pixels", sizes[i]),
0, TQT_TQOBJECT(this),
TQT_SLOT(slotChangeFontSizeFromAction()),
- actionCollection(), actionName);
+ actionCollection(), actionName.ascii());
}
sizeAction->setChecked(sizes[i] == m_fontSize);
@@ -3091,7 +3091,7 @@ void NotationView::setCurrentSelectedNote(const char *pixmapName,
void NotationView::setCurrentSelectedNote(const NoteActionData &noteAction)
{
- setCurrentSelectedNote(noteAction.pixmapName,
+ setCurrentSelectedNote(noteAction.pixmapName.ascii(),
noteAction.rest,
noteAction.noteType,
noteAction.dots);
@@ -3969,7 +3969,7 @@ void NotationView::slotNoteAction()
void NotationView::slotLastNoteAction()
{
- KAction *action = actionCollection()->action(m_lastNoteAction);
+ KAction *action = actionCollection()->action(m_lastNoteAction.ascii());
if (!action)
action = actionCollection()->action("crotchet");
@@ -3977,7 +3977,7 @@ void NotationView::slotLastNoteAction()
action->activate();
} else {
std::cerr << "NotationView::slotNoteAction() : couldn't find action named '"
- << m_lastNoteAction << "' or 'crotchet'\n";
+ << m_lastNoteAction.ascii() << "' or 'crotchet'\n";
}
}
@@ -4332,7 +4332,7 @@ NotationView::slotChangeSpacing(int spacing)
// m_spacingSlider->setSize(spacing);
KToggleAction *action = dynamic_cast<KToggleAction *>
- (actionCollection()->action(TQString("spacing_%1").tqarg(spacing)));
+ (actionCollection()->action(TQString("spacing_%1").tqarg(spacing).ascii()));
if (action)
action->setChecked(true);
else {
@@ -4390,7 +4390,7 @@ NotationView::slotChangeProportion(int proportion)
// m_proportionSlider->setSize(proportion);
KToggleAction *action = dynamic_cast<KToggleAction *>
- (actionCollection()->action(TQString("proportion_%1").tqarg(proportion)));
+ (actionCollection()->action(TQString("proportion_%1").tqarg(proportion).ascii()));
if (action)
action->setChecked(true);
else {
@@ -4544,7 +4544,7 @@ NotationView::slotChangeFont(std::string newName, int newSize)
if (thisOne)
m_fontCombo->setCurrentItem(i);
KToggleAction *action = dynamic_cast<KToggleAction *>
- (actionCollection()->action("note_font_" + strtoqstr(f[i])));
+ (actionCollection()->action(TQString("note_font_" + strtoqstr(f[i])).ascii()));
NOTATION_DEBUG << "inspecting " << f[i] << (action ? ", have action" : ", no action") << endl;
if (action)
action->setChecked(thisOne);
@@ -4869,7 +4869,7 @@ void NotationView::slotEditGeneralPaste()
KMessageBox::detailedError
(this,
i18n("Couldn't paste at this point."),
- i18n(RESTRICTED_PASTE_FAILED_DESCRIPTION));
+ i18n(RESTRICTED_PASTE_FAILED_DESCRIPTION.ascii()));
} else {
addCommandToHistory(command);
setCurrentSelection(new EventSelection
@@ -5146,7 +5146,7 @@ void NotationView::slotToggleTransportToolBar()
void NotationView::toggleNamedToolBar(const TQString& toolBarName, bool* force)
{
- KToolBar *namedToolBar = toolBar(toolBarName);
+ KToolBar *namedToolBar = toolBar(toolBarName.ascii());
if (!namedToolBar) {
NOTATION_DEBUG << "NotationView::toggleNamedToolBar() : toolBar "
@@ -5661,11 +5661,11 @@ void NotationView::slotSwitchFromRestToNote()
actionName = actionName.replace("-", "_");
KRadioAction *action = dynamic_cast<KRadioAction *>
- (actionCollection()->action(actionName));
+ (actionCollection()->action(actionName.ascii()));
if (!action) {
std::cerr << "WARNING: Failed to find note action \""
- << actionName << "\"" << std::endl;
+ << actionName.ascii() << "\"" << std::endl;
} else {
action->activate();
}
@@ -5696,11 +5696,11 @@ void NotationView::slotSwitchFromNoteToRest()
actionName = actionName.replace("-", "_");
KRadioAction *action = dynamic_cast<KRadioAction *>
- (actionCollection()->action(actionName));
+ (actionCollection()->action(actionName.ascii()));
if (!action) {
std::cerr << "WARNING: Failed to find rest action \""
- << actionName << "\"" << std::endl;
+ << actionName.ascii() << "\"" << std::endl;
} else {
action->activate();
}
diff --git a/src/gui/editors/notation/NoteFontFactory.cpp b/src/gui/editors/notation/NoteFontFactory.cpp
index 80e0772..ec0a18f 100644
--- a/src/gui/editors/notation/NoteFontFactory.cpp
+++ b/src/gui/editors/notation/NoteFontFactory.cpp
@@ -78,7 +78,7 @@ NoteFontFactory::getFontNames(bool forceRescan)
TQDir dir(mappingDir);
if (!dir.exists()) {
std::cerr << "NoteFontFactory::getFontNames: mapping directory \""
- << mappingDir << "\" not found" << std::endl;
+ << mappingDir.ascii() << "\" not found" << std::endl;
return m_fontNames;
}
diff --git a/src/gui/editors/notation/NoteFontMap.cpp b/src/gui/editors/notation/NoteFontMap.cpp
index 9036f20..47fc9f5 100644
--- a/src/gui/editors/notation/NoteFontMap.cpp
+++ b/src/gui/editors/notation/NoteFontMap.cpp
@@ -147,7 +147,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString s;
s = attributes.value("name");
- if (s) {
+ if (!s.isNull()) {
m_name = qstrtostr(s);
m_srcDirectory = m_name;
}
@@ -157,28 +157,28 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString s;
s = attributes.value("origin");
- if (s)
+ if (!s.isNull())
m_origin = qstrtostr(s);
s = attributes.value("copyright");
- if (s)
+ if (!s.isNull())
m_copyright = qstrtostr(s);
s = attributes.value("mapped-by");
- if (s)
+ if (!s.isNull())
m_mappedBy = qstrtostr(s);
s = attributes.value("type");
- if (s)
+ if (!s.isNull())
m_type = qstrtostr(s);
s = attributes.value("autocrop");
- if (s) {
+ if (!s.isNull()) {
std::cerr << "Warning: autocrop attribute in note font mapping file is no longer supported\n(all fonts are now always autocropped)" << std::endl;
}
s = attributes.value("smooth");
- if (s)
+ if (!s.isNull())
m_smooth = (s.lower() == "true");
} else if (lcName == "font-sizes") {
@@ -195,46 +195,46 @@ NoteFontMap::startElement(const TQString &, const TQString &,
SizeData &sizeData = m_sizes[noteHeight];
s = attributes.value("staff-line-thickness");
- if (s)
+ if (!s.isNull())
sizeData.setStaffLineThickness(s.toInt());
s = attributes.value("leger-line-thickness");
- if (s)
+ if (!s.isNull())
sizeData.setLegerLineThickness(s.toInt());
s = attributes.value("stem-thickness");
- if (s)
+ if (!s.isNull())
sizeData.setStemThickness(s.toInt());
s = attributes.value("beam-thickness");
- if (s)
+ if (!s.isNull())
sizeData.setBeamThickness(s.toInt());
s = attributes.value("stem-length");
- if (s)
+ if (!s.isNull())
sizeData.setStemLength(s.toInt());
s = attributes.value("flag-spacing");
- if (s)
+ if (!s.isNull())
sizeData.setFlagSpacing(s.toInt());
s = attributes.value("border-x");
- if (s) {
+ if (!s.isNull()) {
std::cerr << "Warning: border-x attribute in note font mapping file is no longer supported\n(use hotspot-x for note head or flag)" << std::endl;
}
s = attributes.value("border-y");
- if (s) {
+ if (!s.isNull()) {
std::cerr << "Warning: border-y attribute in note font mapping file is no longer supported" << std::endl;
}
int fontId = 0;
s = attributes.value("font-id");
- if (s)
+ if (!s.isNull())
fontId = s.toInt();
s = attributes.value("font-height");
- if (s)
+ if (!s.isNull())
sizeData.setFontHeight(fontId, s.toInt());
} else if (lcName == "font-scale") {
@@ -250,7 +250,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString s;
s = attributes.value("font-height");
- if (s)
+ if (!s.isNull())
fontHeight = qstrtodouble(s);
else {
m_errorString = "font-height is a required attribute of font-scale";
@@ -258,32 +258,32 @@ NoteFontMap::startElement(const TQString &, const TQString &,
}
s = attributes.value("staff-line-thickness");
- if (s)
+ if (!s.isNull())
staffLineThickness = qstrtodouble(s);
s = attributes.value("leger-line-thickness");
- if (s)
+ if (!s.isNull())
legerLineThickness = qstrtodouble(s);
s = attributes.value("stem-thickness");
- if (s)
+ if (!s.isNull())
stemThickness = qstrtodouble(s);
s = attributes.value("beam-thickness");
- if (s)
+ if (!s.isNull())
beamThickness = qstrtodouble(s);
s = attributes.value("stem-length");
- if (s)
+ if (!s.isNull())
stemLength = qstrtodouble(s);
s = attributes.value("flag-spacing");
- if (s)
+ if (!s.isNull())
flagSpacing = qstrtodouble(s);
int fontId = 0;
s = attributes.value("font-id");
- if (s)
+ if (!s.isNull())
fontId = s.toInt();
//!!! need to be able to calculate max size -- checkFont needs
@@ -389,7 +389,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
int icode = -1;
bool ok = false;
- if (code) {
+ if (!code.isNull()) {
icode = code.stripWhiteSpace().toInt(&ok);
if (!ok || icode < 0) {
m_errorString =
@@ -402,7 +402,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
int iglyph = -1;
ok = false;
- if (glyph) {
+ if (!glyph.isNull()) {
iglyph = glyph.stripWhiteSpace().toInt(&ok);
if (!ok || iglyph < 0) {
m_errorString =
@@ -417,15 +417,15 @@ NoteFontMap::startElement(const TQString &, const TQString &,
m_errorString = "symbol must have either src, code, or glyph attribute";
return false;
}
- if (src)
+ if (!src.isNull())
symbolData.setSrc(qstrtostr(src));
TQString inversionSrc = attributes.value("inversion-src");
- if (inversionSrc)
+ if (!inversionSrc.isNull())
symbolData.setInversionSrc(qstrtostr(inversionSrc));
TQString inversionCode = attributes.value("inversion-code");
- if (inversionCode) {
+ if (!inversionCode.isNull()) {
icode = inversionCode.stripWhiteSpace().toInt(&ok);
if (!ok || icode < 0) {
m_errorString =
@@ -437,7 +437,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
}
TQString inversionGlyph = attributes.value("inversion-glyph");
- if (inversionGlyph) {
+ if (!inversionGlyph.isNull()) {
iglyph = inversionGlyph.stripWhiteSpace().toInt(&ok);
if (!ok || iglyph < 0) {
m_errorString =
@@ -449,7 +449,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
}
TQString fontId = attributes.value("font-id");
- if (fontId) {
+ if (!fontId.isNull()) {
int n = fontId.stripWhiteSpace().toInt(&ok);
if (!ok || n < 0) {
m_errorString =
@@ -482,7 +482,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString s = attributes.value("x");
double x = -1.0;
- if (s)
+ if (!s.isNull())
x = qstrtodouble(s);
s = attributes.value("y");
@@ -509,12 +509,12 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString s = attributes.value("x");
int x = 0;
- if (s)
+ if (!s.isNull())
x = s.toInt();
s = attributes.value("y");
int y = 0;
- if (s)
+ if (!s.isNull())
y = s.toInt();
HotspotDataMap::iterator i = m_hotspots.find(m_hotspotCharName);
@@ -541,7 +541,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
s = attributes.value("x");
int x = 0;
- if (s)
+ if (!s.isNull())
x = s.toInt();
s = attributes.value("y");
@@ -566,7 +566,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString id = attributes.value("font-id");
int n = -1;
bool ok = false;
- if (id) {
+ if (!id.isNull()) {
n = id.stripWhiteSpace().toInt(&ok);
if (!ok) {
m_errorString =
@@ -582,8 +582,8 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString name = attributes.value("name");
TQString names = attributes.value("names");
- if (name) {
- if (names) {
+ if (!name.isNull()) {
+ if (!names.isNull()) {
m_errorString = "font-requirement may have name or names attribute, but not both";
return false;
}
@@ -595,11 +595,11 @@ NoteFontMap::startElement(const TQString &, const TQString &,
m_systemFontNames[n] = name;
delete font;
} else {
- std::cerr << TQString("Warning: Unable to load font \"%1\"").tqarg(name) << std::endl;
+ std::cerr << TQString("Warning: Unable to load font \"%1\"").tqarg(name).ascii() << std::endl;
m_ok = false;
}
- } else if (names) {
+ } else if (!names.isNull()) {
bool have = false;
TQStringList list = TQStringList::split(",", names, false);
@@ -615,7 +615,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
}
if (!have) {
std::cerr << TQString("Warning: Unable to load any of the fonts in \"%1\"").
- tqarg(names) << std::endl;
+ tqarg(names).ascii() << std::endl;
m_ok = false;
}
@@ -627,7 +627,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
TQString s = attributes.value("strategy").lower();
SystemFont::Strategy strategy = SystemFont::PreferGlyphs;
- if (s) {
+ if (!s.isNull()) {
if (s == "prefer-glyphs")
strategy = SystemFont::PreferGlyphs;
else if (s == "prefer-codes")
@@ -637,7 +637,7 @@ NoteFontMap::startElement(const TQString &, const TQString &,
else if (s == "only-codes")
strategy = SystemFont::OnlyCodes;
else {
- std::cerr << "Warning: Unknown strategy value " << s
+ std::cerr << "Warning: Unknown strategy value " << s.ascii()
<< " (known values are prefer-glyphs, prefer-codes,"
<< " only-glyphs, only-codes)" << std::endl;
}
@@ -725,11 +725,11 @@ NoteFontMap::checkFile(int size, std::string &src) const
if (!pixmapFileLowerInfo.isReadable()) {
if (pixmapFileMixedName != pixmapFileLowerName) {
std::cerr << "Warning: Unable to open pixmap file "
- << pixmapFileMixedName << " or " << pixmapFileLowerName
+ << pixmapFileMixedName.ascii() << " or " << pixmapFileLowerName.ascii()
<< std::endl;
} else {
std::cerr << "Warning: Unable to open pixmap file "
- << pixmapFileMixedName << std::endl;
+ << pixmapFileMixedName.ascii() << std::endl;
}
return false;
} else {
diff --git a/src/gui/editors/notation/NoteInserter.cpp b/src/gui/editors/notation/NoteInserter.cpp
index 2939f89..5b192cc 100644
--- a/src/gui/editors/notation/NoteInserter.cpp
+++ b/src/gui/editors/notation/NoteInserter.cpp
@@ -662,9 +662,9 @@ void NoteInserter::slotToggleDot()
Note note(m_noteType, m_noteDots);
TQString actionName(NotationStrings::getReferenceName(note));
actionName.replace(TQRegExp("-"), "_");
- KAction *action = m_parentView->actionCollection()->action(actionName);
+ KAction *action = m_parentView->actionCollection()->action(actionName.ascii());
if (!action) {
- std::cerr << "WARNING: No such action as " << actionName << std::endl;
+ std::cerr << "WARNING: No such action as " << actionName.ascii() << std::endl;
} else {
action->activate();
}
@@ -690,9 +690,9 @@ void NoteInserter::slotRestsSelected()
Note note(m_noteType, m_noteDots);
TQString actionName(NotationStrings::getReferenceName(note, true));
actionName.replace(TQRegExp("-"), "_");
- KAction *action = m_parentView->actionCollection()->action(actionName);
+ KAction *action = m_parentView->actionCollection()->action(actionName.ascii());
if (!action) {
- std::cerr << "WARNING: No such action as " << actionName << std::endl;
+ std::cerr << "WARNING: No such action as " << actionName.ascii() << std::endl;
} else {
action->activate();
}
diff --git a/src/gui/editors/notation/NotePixmapFactory.cpp b/src/gui/editors/notation/NotePixmapFactory.cpp
index ac9064a..2ff4969 100644
--- a/src/gui/editors/notation/NotePixmapFactory.cpp
+++ b/src/gui/editors/notation/NotePixmapFactory.cpp
@@ -193,7 +193,7 @@ NotePixmapFactory::init(std::string fontName, int size)
m_style = NoteStyleFactory::getStyle(NoteStyleFactory::DefaultStyle);
} catch (NoteStyleFactory::StyleUnavailable u) {
KStartupLogo::hideIfStillThere();
- KMessageBox::error(0, i18n(strtoqstr(u.getMessage())));
+ KMessageBox::error(0, i18n(strtoqstr(u.getMessage()).ascii()));
throw;
}
@@ -1969,7 +1969,7 @@ NotePixmapFactory::makeNoteMenuPixmap(timeT duration,
if (triplet)
noteName = "3-" + noteName;
noteName = "menu-" + noteName;
- return makeToolbarPixmap(noteName);
+ return makeToolbarPixmap(noteName.ascii());
}
TQCanvasPixmap *
diff --git a/src/gui/editors/notation/NoteStyleFactory.cpp b/src/gui/editors/notation/NoteStyleFactory.cpp
index d394e8b..d5e0815 100644
--- a/src/gui/editors/notation/NoteStyleFactory.cpp
+++ b/src/gui/editors/notation/NoteStyleFactory.cpp
@@ -52,7 +52,7 @@ NoteStyleFactory::getAvailableStyleNames()
TQString styleDir = KGlobal::dirs()->findResource("appdata", "styles/");
TQDir dir(styleDir);
if (!dir.exists()) {
- std::cerr << "NoteStyle::getAvailableStyleNames: directory \"" << styleDir
+ std::cerr << "NoteStyle::getAvailableStyleNames: directory \"" << styleDir.ascii()
<< "\" not found" << std::endl;
return names;
}
diff --git a/src/gui/editors/notation/NoteStyleFileReader.cpp b/src/gui/editors/notation/NoteStyleFileReader.cpp
index b7e04ef..b8619c9 100644
--- a/src/gui/editors/notation/NoteStyleFileReader.cpp
+++ b/src/gui/editors/notation/NoteStyleFileReader.cpp
@@ -81,7 +81,7 @@ NoteStyleFileReader::startElement(const TQString &, const TQString &,
if (lcName == "rosegarden-note-style") {
TQString s = attributes.value("base-style");
- if (s) m_style->setBaseStyle(qstrtostr(s));
+ if (!s.isNull()) m_style->setBaseStyle(qstrtostr(s));
} else if (lcName == "note") {
@@ -126,13 +126,13 @@ NoteStyleFileReader::setFromAttributes(Note::Type type,
bool haveShape = false;
s = attributes.value("tqshape");
- if (s) {
+ if (!s.isNull()) {
m_style->setShape(type, qstrtostr(s.lower()));
haveShape = true;
}
s = attributes.value("charname");
- if (s) {
+ if (!s.isNull()) {
if (haveShape) {
m_errorString = i18n("global and note elements may have tqshape "
"or charname attribute, but not both");
@@ -143,16 +143,16 @@ NoteStyleFileReader::setFromAttributes(Note::Type type,
}
s = attributes.value("filled");
- if (s) m_style->setFilled(type, s.lower() == "true");
+ if (!s.isNull()) m_style->setFilled(type, s.lower() == "true");
s = attributes.value("stem");
- if (s) m_style->setStem(type, s.lower() == "true");
+ if (!s.isNull()) m_style->setStem(type, s.lower() == "true");
s = attributes.value("flags");
- if (s) m_style->setFlagCount(type, s.toInt());
+ if (!s.isNull()) m_style->setFlagCount(type, s.toInt());
s = attributes.value("slashes");
- if (s) m_style->setSlashCount(type, s.toInt());
+ if (!s.isNull()) m_style->setSlashCount(type, s.toInt());
NoteStyle::HFixPoint hfix;
NoteStyle::VFixPoint vfix;
@@ -161,7 +161,7 @@ NoteStyleFileReader::setFromAttributes(Note::Type type,
bool haveVFix = false;
s = attributes.value("hfixpoint");
- if (s) {
+ if (!s.isNull()) {
s = s.lower();
haveHFix = true;
if (s == "normal") hfix = NoteStyle::Normal;
@@ -171,7 +171,7 @@ NoteStyleFileReader::setFromAttributes(Note::Type type,
}
s = attributes.value("vfixpoint");
- if (s) {
+ if (!s.isNull()) {
s = s.lower();
haveVFix = true;
if (s == "near") vfix = NoteStyle::Near;
diff --git a/src/gui/editors/notation/RestInserter.cpp b/src/gui/editors/notation/RestInserter.cpp
index 9889253..d55dd3e 100644
--- a/src/gui/editors/notation/RestInserter.cpp
+++ b/src/gui/editors/notation/RestInserter.cpp
@@ -128,9 +128,9 @@ void RestInserter::slotToggleDot()
Note note(m_noteType, m_noteDots);
TQString actionName(NotationStrings::getReferenceName(note, true));
actionName.replace(TQRegExp("-"), "_");
- KAction *action = m_parentView->actionCollection()->action(actionName);
+ KAction *action = m_parentView->actionCollection()->action(actionName.ascii());
if (!action) {
- std::cerr << "WARNING: No such action as " << actionName << std::endl;
+ std::cerr << "WARNING: No such action as " << actionName.ascii() << std::endl;
} else {
action->activate();
}
@@ -141,7 +141,7 @@ void RestInserter::slotNotesSelected()
Note note(m_noteType, m_noteDots);
TQString actionName(NotationStrings::getReferenceName(note));
actionName.replace(TQRegExp(" "), "_");
- m_parentView->actionCollection()->action(actionName)->activate();
+ m_parentView->actionCollection()->action(actionName.ascii())->activate();
}
const TQString RestInserter::ToolName = "restinserter";