Commit de9fb632 authored by Mateusz Łukasik's avatar Mateusz Łukasik

Merge tag 'upstream/3.8.2'

Upstream version 3.8.2
parents 260cd913 e71d3c04
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for audacious 3.8.1.
# Generated by GNU Autoconf 2.69 for audacious 3.8.2.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
......@@ -9,7 +9,7 @@
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
#
# Copyright (C) 2001-2016 Audacious developers and others
# Copyright (C) 2001-2017 Audacious developers and others
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
......@@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='audacious'
PACKAGE_TARNAME='audacious'
PACKAGE_VERSION='3.8.1'
PACKAGE_STRING='audacious 3.8.1'
PACKAGE_VERSION='3.8.2'
PACKAGE_STRING='audacious 3.8.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
......@@ -1365,7 +1365,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures audacious 3.8.1 to adapt to many kinds of systems.
\`configure' configures audacious 3.8.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1431,7 +1431,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of audacious 3.8.1:";;
short | recursive ) echo "Configuration of audacious 3.8.2:";;
esac
cat <<\_ACEOF
......@@ -1563,14 +1563,14 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
audacious configure 3.8.1
audacious configure 3.8.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
Copyright (C) 2001-2016 Audacious developers and others
Copyright (C) 2001-2017 Audacious developers and others
_ACEOF
exit
fi
......@@ -2031,7 +2031,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by audacious $as_me 3.8.1, which was
It was created by audacious $as_me 3.8.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2393,7 +2393,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
COPYRIGHT="Copyright (C) 2001-2016 Audacious developers and others"
COPYRIGHT="Copyright (C) 2001-2017 Audacious developers and others"
cat >>confdefs.h <<_ACEOF
#define COPYRIGHT "$COPYRIGHT"
......@@ -10366,7 +10366,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by audacious $as_me 3.8.1, which was
This file was extended by audacious $as_me 3.8.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -10432,7 +10432,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
audacious config.status 3.8.1
audacious config.status 3.8.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -6,13 +6,13 @@ dnl Initialize
dnl ==========
AC_PREREQ([2.59])
AC_INIT([audacious], [3.8.1])
AC_COPYRIGHT([Copyright (C) 2001-2016 Audacious developers and others])
AC_INIT([audacious], [3.8.2])
AC_COPYRIGHT([Copyright (C) 2001-2017 Audacious developers and others])
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Version number of package])
COPYRIGHT="Copyright (C) 2001-2016 Audacious developers and others"
COPYRIGHT="Copyright (C) 2001-2017 Audacious developers and others"
AC_DEFINE_UNQUOTED(COPYRIGHT, "$COPYRIGHT", [Copyright])
AC_SUBST(COPYRIGHT)
......
......@@ -50,7 +50,10 @@ struct LogEntry {
const char * filename;
unsigned int line;
const char * function;
char * message;
char * message = nullptr;
~LogEntry ()
{ free (message); }
};
static Index<SmartPtr<LogEntry>> entries;
......@@ -79,9 +82,13 @@ int LogEntryModel::columnCount (const QModelIndex & parent) const
QVariant LogEntryModel::data (const QModelIndex & index, int role) const
{
auto & e = entries [index.row ()];
int row = index.row ();
if (row < 0 || row >= entries.len ())
return QVariant ();
if (e && role == Qt::DisplayRole)
auto & e = entries[row];
if (role == Qt::DisplayRole)
{
switch (index.column ())
{
......@@ -113,33 +120,18 @@ QVariant LogEntryModel::headerData (int section, Qt::Orientation orientation, in
return QVariant ();
}
bool LogEntryModel::insertRows (int row, int count, const QModelIndex & parent)
{
int last = row + count - 1;
beginInsertRows (parent, row, last);
endInsertRows ();
return true;
}
bool LogEntryModel::removeRows (int row, int count, const QModelIndex & parent)
{
int last = row + count - 1;
beginRemoveRows (parent, row, last);
endRemoveRows ();
return true;
}
void LogEntryModel::updateRows (int row, int count)
void LogEntryModel::addEntry (LogEntry * entry)
{
int bottom = row + count - 1;
auto topLeft = createIndex (row, 0);
auto bottomRight = createIndex (bottom, columnCount () - 1);
emit dataChanged (topLeft, bottomRight);
}
if (entries.len () >= LOGENTRY_MAX)
{
beginRemoveRows (QModelIndex (), 0, 0);
entries.remove (0, 1);
endRemoveRows ();
}
void LogEntryModel::updateRow (int row)
{
updateRows (row, 1);
beginInsertRows (QModelIndex (), entries.len (), entries.len ());
entries.append (SmartPtr<LogEntry> (entry));
endInsertRows ();
}
/* log entry inspector */
......@@ -151,8 +143,8 @@ public:
audlog::Level m_level;
void pop ();
void push ();
void addEntry (LogEntry * entry)
{ m_model->addEntry (entry); }
private:
QVBoxLayout m_layout;
......@@ -224,15 +216,7 @@ static void log_handler (audlog::Level level, const char * file, int line,
l->message = strdup (message);
l->message[strlen (l->message) - 1] = 0;
entries.append (SmartPtr<LogEntry> (l));
if (entries.len () > LOGENTRY_MAX)
{
s_inspector->pop ();
entries.erase (0, 1);
}
s_inspector->push ();
s_inspector->addEntry (l);
}
void LogEntryInspector::setLogLevel (audlog::Level level)
......@@ -245,20 +229,6 @@ void LogEntryInspector::setLogLevel (audlog::Level level)
m_level_combobox.setCurrentIndex (m_level);
}
void LogEntryInspector::pop ()
{
m_model->removeRows (0, 1);
}
void LogEntryInspector::push ()
{
m_model->insertRows (entries.len (), 1);
#ifdef XXX_NOTYET
auto index = m_model->index (entries.len () - 1);
m_view->scrollTo (index);
#endif
}
EXPORT void log_inspector_show ()
{
if (! s_inspector)
......
......@@ -24,6 +24,8 @@
namespace audqt {
struct LogEntry;
class LogEntryModel : public QAbstractListModel
{
public:
......@@ -35,10 +37,7 @@ public:
QVariant data (const QModelIndex & index, int role = Qt::DisplayRole) const;
QVariant headerData (int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
bool insertRows (int row, int count, const QModelIndex & parent = QModelIndex ());
bool removeRows (int row, int count, const QModelIndex & parent = QModelIndex ());
void updateRows (int row, int count);
void updateRow (int row);
void addEntry (LogEntry * entry);
};
} // namespace audqt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment