summaryrefslogtreecommitdiffstats
path: root/src/TextViewLog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextViewLog.cpp')
-rw-r--r--src/TextViewLog.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/TextViewLog.cpp b/src/TextViewLog.cpp
index 33b7d22..712b760 100644
--- a/src/TextViewLog.cpp
+++ b/src/TextViewLog.cpp
@@ -1,18 +1,5 @@
-/* This file is part of Patchage.
- * Copyright 2007-2020 David Robillard <d@drobilla.net>
- *
- * Patchage is free software: you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free
- * Software Foundation, either version 3 of the License, or (at your option)
- * any later version.
- *
- * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Patchage. If not, see <http://www.gnu.org/licenses/>.
- */
+// Copyright 2007-2020 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: GPL-3.0-or-later
#include "TextViewLog.hpp"
@@ -58,7 +45,7 @@ TextViewLog::TextViewLog(Widget<Gtk::TextView>& text_view)
void
TextViewLog::info(const std::string& msg)
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
+ const Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
buffer->insert(buffer->end(), std::string("\n") + msg);
_text_view->scroll_to_mark(buffer->get_insert(), 0);
}
@@ -66,7 +53,7 @@ TextViewLog::info(const std::string& msg)
void
TextViewLog::warning(const std::string& msg)
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
+ const Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
buffer->insert_with_tag(buffer->end(), std::string("\n") + msg, _warning_tag);
_text_view->scroll_to_mark(buffer->get_insert(), 0);
}
@@ -74,7 +61,7 @@ TextViewLog::warning(const std::string& msg)
void
TextViewLog::error(const std::string& msg)
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
+ const Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
buffer->insert_with_tag(buffer->end(), std::string("\n") + msg, _error_tag);
_text_view->scroll_to_mark(buffer->get_insert(), 0);
}
@@ -82,7 +69,7 @@ TextViewLog::error(const std::string& msg)
int
TextViewLog::min_height() const
{
- Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
+ const Glib::RefPtr<Gtk::TextBuffer> buffer = _text_view->get_buffer();
int y = 0;
int line_height = 0;