[PATCH] Don't add <space> between buddy tags

Anton Lundin glance at acc.umu.se
Wed Nov 5 22:45:15 PST 2014


On 05 November, 2014 - Dirk Hohndel wrote:

> I don't understand the commit message. Can you elaborat? What does this
> fix? Your commit message seems to imply that things were better WITHOUT
> your commit...
> 

I was obviously a bit to tired last night to produce usefull commits.

That was ment as a reference to:
20141105221213.GH25725 at kennedy.acc.umu.se

Eg. Without this patch, when you write your buddy list It will become
Minion1, Minion2, Minion3 separated by ,<space>.

When the filter-buddy-tag-thingie then ingests that line, splitting on ,
and not using the .trimmed() version of the splitted strings, you get
some buddy names starting with a <space> in the
filter-buddy-tag-thingie.


This patch was a attempt to fix that, but after i sent this one out i
figured out that the propper fix is probably to fix it in the
filter-buddy-tag-thingie.


//Anton


> On Wed, Nov 05, 2014 at 10:54:33PM +0100, Anton Lundin wrote:
> > The second buddy tag will then contain a space, due to that the internal
> > splitter is the comma, and not the ,<space>.
> > 
> > It actually looked better in the ui with ,<space>.
> > 
> > Signed-off-by: Anton Lundin <glance at acc.umu.se>
> > ---
> >  qt-ui/maintab.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
> > index 545632f..b5cde40 100644
> > --- a/qt-ui/maintab.cpp
> > +++ b/qt-ui/maintab.cpp
> > @@ -923,7 +923,7 @@ void MainTab::on_buddy_textChanged()
> >  	QStringList text_list = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts);
> >  	for (int i = 0; i < text_list.size(); i++)
> >  		text_list[i] = text_list[i].trimmed();
> > -	QString text = text_list.join(", ");
> > +	QString text = text_list.join(",");
> >  	free(displayed_dive.buddy);
> >  	displayed_dive.buddy = strdup(text.toUtf8().data());
> >  	markChangedWidget(ui.buddy);
> > @@ -936,7 +936,7 @@ void MainTab::on_divemaster_textChanged()
> >  	QStringList text_list = ui.divemaster->toPlainText().split(",", QString::SkipEmptyParts);
> >  	for (int i = 0; i < text_list.size(); i++)
> >  		text_list[i] = text_list[i].trimmed();
> > -	QString text = text_list.join(", ");
> > +	QString text = text_list.join(",");
> >  	free(displayed_dive.divemaster);
> >  	displayed_dive.divemaster = strdup(text.toUtf8().data());
> >  	markChangedWidget(ui.divemaster);
> > -- 
> > 1.9.1
> > 
> > _______________________________________________
> > subsurface mailing list
> > subsurface at subsurface-divelog.org
> > http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

-- 
Anton Lundin	+46702-161604


More information about the subsurface mailing list