diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:01:17 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:01:17 -0600 |
commit | 2a411f53a04f815770074b633e026a141f6fa875 (patch) | |
tree | 0408d7c0976f54b4b6d13e8fbf5d91a82cb4ff92 /src/notecontent.cpp | |
parent | ae6cafee5339716bd01aa6c66aa4f366bdc5d43b (diff) | |
download | basket-2a411f53a04f815770074b633e026a141f6fa875.tar.gz basket-2a411f53a04f815770074b633e026a141f6fa875.zip |
Rename old tq methods that no longer need a unique name
Diffstat (limited to 'src/notecontent.cpp')
-rw-r--r-- | src/notecontent.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/notecontent.cpp b/src/notecontent.cpp index 7dc7e17..01f56dc 100644 --- a/src/notecontent.cpp +++ b/src/notecontent.cpp @@ -152,7 +152,7 @@ Basket* NoteContent::basket() void NoteContent::setEdited() { - note()->setLastModificationDate(TQDateTime::tqcurrentDateTime()); + note()->setLastModificationDate(TQDateTime::currentDateTime()); basket()->save(); } @@ -378,14 +378,14 @@ TQPixmap HtmlContent::feedbackPixmap(int width, int height) { TQSimpleRichText richText(html(), note()->font()); richText.setWidth(width); - TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); - tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); - tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + TQColorGroup colorGroup(basket()->colorGroup()); + colorGroup.setColor(TQColorGroup::Text, note()->textColor()); + colorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); TQPixmap pixmap( TQMIN(width, richText.widthUsed()), TQMIN(height, richText.height()) ); pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); TQPainter painter(&pixmap); painter.setPen(note()->textColor()); - richText.draw(&painter, 0, 0, TQRect(0, 0, pixmap.width(), pixmap.height()), tqcolorGroup); + richText.draw(&painter, 0, 0, TQRect(0, 0, pixmap.width(), pixmap.height()), colorGroup); painter.end(); return pixmap; } @@ -433,10 +433,10 @@ TQPixmap AnimationContent::feedbackPixmap(int width, int height) TQPixmap LinkContent::feedbackPixmap(int width, int height) { - TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); - tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); - tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); + TQColorGroup colorGroup(basket()->colorGroup()); + colorGroup.setColor(TQColorGroup::Text, note()->textColor()); + colorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); } TQPixmap ColorContent::feedbackPixmap(int width, int height) @@ -446,45 +446,45 @@ TQPixmap ColorContent::feedbackPixmap(int width, int height) int rectHeight = (textRect.height() + 2)*3/2; int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers. - TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); - tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); - tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + TQColorGroup colorGroup(basket()->colorGroup()); + colorGroup.setColor(TQColorGroup::Text, note()->textColor()); + colorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); TQPixmap pixmap( TQMIN(width, rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN), TQMIN(height, rectHeight) ); pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING)); TQPainter painter(&pixmap); - paint(&painter, pixmap.width(), pixmap.height(), tqcolorGroup, false, false, false); // We don't care of the three last boolean parameters. + paint(&painter, pixmap.width(), pixmap.height(), colorGroup, false, false, false); // We don't care of the three last boolean parameters. painter.end(); return pixmap; } TQPixmap FileContent::feedbackPixmap(int width, int height) { - TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); - tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); - tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); + TQColorGroup colorGroup(basket()->colorGroup()); + colorGroup.setColor(TQColorGroup::Text, note()->textColor()); + colorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); } TQPixmap LauncherContent::feedbackPixmap(int width, int height) { - TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); - tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); - tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); - return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); + TQColorGroup colorGroup(basket()->colorGroup()); + colorGroup.setColor(TQColorGroup::Text, note()->textColor()); + colorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor()); } TQPixmap UnknownContent::feedbackPixmap(int width, int height) { TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes); - TQColorGroup tqcolorGroup(basket()->tqcolorGroup()); - tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor()); - tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); + TQColorGroup colorGroup(basket()->colorGroup()); + colorGroup.setColor(TQColorGroup::Text, note()->textColor()); + colorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING)); TQPixmap pixmap( TQMIN(width, DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN), TQMIN(height, DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN) ); TQPainter painter(&pixmap); - paint(&painter, pixmap.width() + 1, pixmap.height(), tqcolorGroup, false, false, false); // We don't care of the three last boolean parameters. + paint(&painter, pixmap.width() + 1, pixmap.height(), colorGroup, false, false, false); // We don't care of the three last boolean parameters. painter.setPen(note()->backgroundColor().dark(FEEDBACK_DARKING)); painter.drawPoint(0, 0); painter.drawPoint(pixmap.width() - 1, 0); @@ -520,11 +520,11 @@ int TextContent::setWidthAndGetHeight(int width) return 10; // Lazy loaded } -void TextContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void TextContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { if (m_simpleRichText) { width -= 1; - m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), tqcolorGroup); + m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), colorGroup); } } @@ -629,11 +629,11 @@ int HtmlContent::setWidthAndGetHeight(int width) return 10; // Lazy loaded } -void HtmlContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void HtmlContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { if (m_simpleRichText) { width -= 1; - m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), tqcolorGroup); + m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), colorGroup); } } @@ -735,7 +735,7 @@ int ImageContent::setWidthAndGetHeight(int width) } } -void ImageContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*tqcolorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void ImageContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*colorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { width -= 1; // KPixmap pixmap = m_pixmap; @@ -855,7 +855,7 @@ void ImageContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) int AnimationContent::INVALID_STATUS = -100; AnimationContent::AnimationContent(Note *parent, const TQString &fileName, bool lazyLoad) - : NoteContent(parent, fileName), m_oldtqStatus(INVALID_STATUS) + : NoteContent(parent, fileName), m_oldStatus(INVALID_STATUS) { basket()->addWatchedFile(fullPath()); loadFromFile(lazyLoad); @@ -867,7 +867,7 @@ int AnimationContent::setWidthAndGetHeight(int /*width*/) return m_movie.framePixmap().height() ; // TODO!!! } -void AnimationContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*tqcolorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void AnimationContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*colorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { /*width -= 1*/; // DEBUG_WIN << "AnimationContent::paint()"; @@ -929,7 +929,7 @@ bool AnimationContent::setMovie(const TQMovie &movie) m_movie = movie; m_movie.connectUpdate( this, TQT_SLOT(movieUpdated(const TQRect&)) ); m_movie.connectResize( this, TQT_SLOT(movieResized(const TQSize&)) ); - m_movie.connectStatus( this, TQT_SLOT(movietqStatus(int)) ); + m_movie.connectStatus( this, TQT_SLOT(movieStatus(int)) ); contentChanged( m_movie.framePixmap().width() + 1 ); // TODO return true; } @@ -953,21 +953,21 @@ void AnimationContent::movieResized(const TQSize&) * - For animation: TQMovie::EndOfFrame... (for each image), TQMovie::EndOfLoop, * and it then restart that for each loop. */ -void AnimationContent::movietqStatus(int status) +void AnimationContent::movieStatus(int status) { DEBUG_WIN << "movieStatus()"; // At least two frames: it's an animation, everything is OK - if (m_oldtqStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfFrame) { + if (m_oldStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfFrame) { movie().disconnectStatus(this); - m_oldtqStatus = INVALID_STATUS; + m_oldStatus = INVALID_STATUS; // if (note()->isFocused()) // When inserting a new note we ensure it visble // basket()->ensureNoteVisible(note()); // But after loading it has certainly grown and if it was } // Only one image: it's an image, change note's type - else if (m_oldtqStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfLoop) { + else if (m_oldStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfLoop) { movie().disconnectStatus(this); - m_oldtqStatus = INVALID_STATUS; + m_oldStatus = INVALID_STATUS; note()->setContent(new ImageContent(note(), fileName())); basket()->save(); //delete this; // CRASH, as always !!!!!!!!! @@ -977,7 +977,7 @@ void AnimationContent::movietqStatus(int status) // TQTimer::singleShot(25, note(), TQT_SLOT(delayedEnsureVisible())); } else - m_oldtqStatus = status; + m_oldStatus = status; } void AnimationContent::exportToHTML(HTMLExporter *exporter, int /*indent*/) @@ -1004,9 +1004,9 @@ int FileContent::setWidthAndGetHeight(int width) return m_linkDisplay.height(); } -void FileContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) +void FileContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) { - m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); + m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); } bool FileContent::loadFromFile(bool /*lazyLoad*/) @@ -1221,9 +1221,9 @@ int LinkContent::setWidthAndGetHeight(int width) return m_linkDisplay.height(); } -void LinkContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) +void LinkContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) { - m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); + m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); } void LinkContent::saveToNode(TQDomDocument &doc, TQDomElement &content) @@ -1407,9 +1407,9 @@ int LauncherContent::setWidthAndGetHeight(int width) return m_linkDisplay.height(); } -void LauncherContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) +void LauncherContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) { - m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); + m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0); } bool LauncherContent::loadFromFile(bool /*lazyLoad*/) // TODO: saveToFile() ?? Is it possible? @@ -1527,7 +1527,7 @@ int ColorContent::setWidthAndGetHeight(int /*width*/) // We do not need width be return rectHeight; } -void ColorContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void ColorContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { // FIXME: Duplicate from setColor(): TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name()); @@ -1553,7 +1553,7 @@ void ColorContent::paint(TQPainter *painter, int width, int height, const TQColo // Draw the text: painter->setFont(note()->font()); - painter->setPen(tqcolorGroup.text()); + painter->setPen(colorGroup.text()); painter->drawText(rectWidth + RECT_MARGIN, 0, width - rectWidth - RECT_MARGIN, height, TQt::AlignAuto | TQt::AlignVCenter, color().name()); } @@ -1814,29 +1814,29 @@ extern void drawGradient( TQPainter *p, const TQColor &colorTop, const TQColor & int x, int y, int w, int h, bool sunken, bool horz, bool flat ); /*const*/ -void UnknownContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) +void UnknownContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/) { width -= 1; - painter->setPen(tqcolorGroup.text()); + painter->setPen(colorGroup.text()); // FIXME: Duplicate from ColorContent::paint() and CommonColorSelector::drawColorRect: // Fill with gradient: - drawGradient(painter, tqcolorGroup.background(), tqcolorGroup.background().dark(110), 1, 1, width - 2, height - 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false); + drawGradient(painter, colorGroup.background(), colorGroup.background().dark(110), 1, 1, width - 2, height - 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false); // Stroke: - TQColor stroke = Tools::mixColor(tqcolorGroup.background(), tqcolorGroup.text()); + TQColor stroke = Tools::mixColor(colorGroup.background(), colorGroup.text()); painter->setPen(stroke); painter->drawLine(1, 0, width - 2, 0); painter->drawLine(0, 1, 0, height - 2); painter->drawLine(1, height - 1, width - 2, height - 1); painter->drawLine(width - 1, 1, width - 1, height - 2); // Round corners: - painter->setPen(Tools::mixColor(tqcolorGroup.background(), stroke)); + painter->setPen(Tools::mixColor(colorGroup.background(), stroke)); painter->drawPoint(1, 1); painter->drawPoint(1, height - 2); painter->drawPoint(width - 2, height - 2); painter->drawPoint(width - 2, 1); - painter->setPen(tqcolorGroup.text()); + painter->setPen(colorGroup.text()); painter->drawText(DECORATION_MARGIN, DECORATION_MARGIN, width - 2*DECORATION_MARGIN, height - 2*DECORATION_MARGIN, TQt::AlignAuto | TQt::AlignVCenter | TQt::WordBreak, m_mimeTypes); } |