playlistsplitter.cpp 19.6 KB
Newer Older
1 2 3 4 5
/***************************************************************************
                          playlistsplitter.cpp  -  description
                             -------------------
    begin                : Fri Sep 13 2002
    copyright            : (C) 2002 by Scott Wheeler
6
    email                : wheeler@kde.org
7 8 9 10 11 12 13 14 15 16 17
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

18
#include <klocale.h>
19
#include <kiconloader.h>
20
#include <kapplication.h>
21
#include <kstandarddirs.h>
22
#include <kmessagebox.h>
23
#include <kdirwatch.h>
Nadeem Hasan's avatar
Nadeem Hasan committed
24
#include <klineeditdlg.h>
25 26
#include <kdebug.h>

27
#include <qtimer.h>
28

29
#include "playlistitem.h"
30
#include "playlistsplitter.h"
31
#include "collectionlist.h"
32
#include "directorylist.h"
33
#include "playlist.h"
34
#include "playlistsearch.h"
35

36 37
QStringList *PlaylistSplitter::m_mediaExtensions = 0;
QStringList *PlaylistSplitter::m_listExtensions = 0;
38 39

////////////////////////////////////////////////////////////////////////////////
40
// helper functions
41 42
////////////////////////////////////////////////////////////////////////////////

43
void processEvents()
44
{
45 46 47
    static int processed = 0;
    if(processed == 0)
        kapp->processEvents();
48
    processed = (processed + 1) % 5;
49 50
}

51
////////////////////////////////////////////////////////////////////////////////
52
// public methods
53 54
////////////////////////////////////////////////////////////////////////////////

55
PlaylistSplitter::PlaylistSplitter(QWidget *parent, bool restore, const char *name) : QSplitter(Qt::Horizontal, parent, name), 
56 57
										      m_playingItem(0), m_dynamicList(0),
										      m_restore(restore), m_nextPlaylistItem(0)
58
{
59 60 61 62 63 64 65 66
    if(!m_mediaExtensions && !m_listExtensions) {
	m_mediaExtensions = new QStringList();
	m_listExtensions = new QStringList();

	m_mediaExtensions->append("mp3");
	m_mediaExtensions->append("ogg");
	m_listExtensions->append("m3u");
    }
67 68 69

    setupLayout();
    readConfig();
70 71

    m_editor->slotUpdateCollection();
72
}
73

74
PlaylistSplitter::~PlaylistSplitter()
75
{
Scott Wheeler's avatar
Scott Wheeler committed
76
    delete m_dirWatch;
77
    saveConfig();
78 79
}

80
QString PlaylistSplitter::uniquePlaylistName(const QString &startingWith, bool useParenthesis)
81
{
82
    if(!m_playlistBox)
83
	return QString::null;
84

85
    QStringList names = m_playlistBox->names();
86 87 88 89 90 91

    int playlistNumber = 1;

    // while the list contains more than zero instances of the generated 
    // string...

92 93 94 95
    if(useParenthesis) {
	while(names.contains(startingWith + " (" + QString::number(playlistNumber) + ")") != 0)
	    playlistNumber++;
	
96
	return startingWith + " (" + QString::number(playlistNumber) + ")";	
97 98 99 100 101 102
    }
    else
    {
	while(names.contains(startingWith + ' ' + QString::number(playlistNumber)) != 0)
	    playlistNumber++;
	
103
	return startingWith + " " + QString::number(playlistNumber);
104
    }
105 106
}

107
QString PlaylistSplitter::playNextFile(bool random, bool loopPlaylist)
108
{
109 110
    PlaylistItem *i;

111 112 113
    // Four basic cases here:  (1) We've asked for a specific next item, (2) play
    // the item that's after the currently playing item, (3) play the selected 
    // item or (4) play the first item in the list.
114

115
    if(m_nextPlaylistItem && m_nextPlaylistItem != m_playingItem) {
116 117 118
        i = m_nextPlaylistItem;
        m_nextPlaylistItem = 0;
    }
119
    else if(m_playingItem) {
120 121
        Playlist *p = static_cast<Playlist *>(m_playingItem->listView());
        i = p->nextItem(m_playingItem, random);
122
        if(!i && loopPlaylist)
123
            i = static_cast<PlaylistItem *>(p->firstChild());
124 125
    }
    else {
126
        i = playlistSelection().first();
127 128
        if(!i)
            i = static_cast<PlaylistItem *>(visiblePlaylist()->firstChild());
129 130
    }

131
    return play(i);
132 133
}

134
QString PlaylistSplitter::playPreviousFile(bool random)
135
{
136
    if(!m_playingItem)
137
	return QString::null;
138

139 140
    Playlist *p = static_cast<Playlist *>(m_playingItem->listView());
    PlaylistItem *i = p->previousItem(m_playingItem, random);
141

142
    return play(i);
143 144
}

145 146 147 148 149 150 151 152
QString PlaylistSplitter::playSelectedFile()
{
    if(playlistSelection().isEmpty())
	return QString::null;
    else
	return play(playlistSelection().first());
}

153 154 155 156
QString PlaylistSplitter::playFirstFile()
{
    Playlist *p = visiblePlaylist();
    PlaylistItem *i = static_cast<PlaylistItem *>(p->firstChild());
157

158
    return play(i);
159 160
}

161 162
void PlaylistSplitter::stop()
{
163 164
    m_nextPlaylistItem = 0;

165 166 167 168 169
    if(!m_playingItem)
	return;

    Playlist *p = static_cast<Playlist *>(m_playingItem->listView());

170 171 172
    if(p)
	p->setPlaying(m_playingItem, false);

173
    m_playingItem = 0;
174 175 176 177
}

QString PlaylistSplitter::playingArtist() const
{
178 179
    if(m_playingItem)
	return m_playingItem->text(PlaylistItem::ArtistColumn);
180
    else
181
	return QString::null;
182 183 184 185
}

QString PlaylistSplitter::playingTrack() const
{
186 187
    if(m_playingItem)
	return m_playingItem->text(PlaylistItem::TrackColumn);
188
    else
189
	return QString::null;
190 191 192 193
}

QString PlaylistSplitter::playingList() const
{
194 195
    if(m_playingItem)
	return static_cast<Playlist *>(m_playingItem->listView())->name();
196
    else
197
	return QString::null;
198 199
}

200
QString PlaylistSplitter::extensionsString(const QStringList &extensions, const QString &type) // static
201
{
202 203 204 205 206 207 208 209 210 211 212 213
    QStringList l;

    for(QStringList::ConstIterator it = extensions.begin(); it != extensions.end(); ++it)
	l.append(QString("*." + (*it)));

    // i.e. "*.m3u, *.mp3|Media Files"

    QString s = l.join(" ");

    if(type != QString::null)
	s += "|" + type + " (" + l.join(", ") + ")";

214
    return s;
215 216
}

217 218
void PlaylistSplitter::open(const QString &file) 
{
219 220 221
    if(file.isEmpty())
	return;

222
    if(visiblePlaylist() == m_collection || 
223 224 225 226 227 228
       KMessageBox::questionYesNo(this, 
				  i18n("Do you want to add this item to the current list or to the collection list?"), 
				  QString::null, 
				  KGuiItem(i18n("Current")), 
				  KGuiItem(i18n("Collection"))) == KMessageBox::No)
    {
229
	slotAddToPlaylist(file, m_collection);
230
    }
231
    else
232
	slotAddToPlaylist(file, visiblePlaylist());
233 234 235 236
}

void PlaylistSplitter::open(const QStringList &files) 
{
237 238 239
    if(files.isEmpty())
	return;
    
240
    if(visiblePlaylist() == m_collection || 
241 242 243 244 245 246
       KMessageBox::questionYesNo(this, 
				  i18n("Do you want to add these items to the current list or to the collection list?"), 
				  QString::null, 
				  KGuiItem(i18n("Current")), 
				  KGuiItem(i18n("Collection"))) == KMessageBox::No) 
    {
247
	slotAddToPlaylist(files, m_collection);
248
    }
249
    else
250
	slotAddToPlaylist(files, visiblePlaylist());
251 252 253 254
}

Playlist *PlaylistSplitter::createPlaylist(const QString &name)
{
255
    Playlist *p = new Playlist(m_playlistStack, name.latin1());
256 257
    setupPlaylist(p, true);
    return p;
258 259
}

260 261 262 263
////////////////////////////////////////////////////////////////////////////////
// public slots
////////////////////////////////////////////////////////////////////////////////

264
void PlaylistSplitter::slotOpen()
265
{
266 267
    QStringList files = KFileDialog::getOpenFileNames(
	QString::null, extensionsString((*m_mediaExtensions + *m_listExtensions), i18n("Media Files")));
268 269 270
    open(files);
}

271
void PlaylistSplitter::slotOpenDirectory()
272
{ 
273
    DirectoryList *l = new DirectoryList(m_directoryList, this, "directoryList");
274

275
    m_directoryQueue.clear();
276
    m_directoryQueueRemove.clear();
277

278 279 280 281
    connect(l, SIGNAL(signalDirectoryAdded(const QString &)), 
	    this, SLOT(slotQueueDirectory(const QString &)));
    connect(l, SIGNAL(signalDirectoryRemoved(const QString &)), 
	    this, SLOT(slotQueueDirectoryRemove(const QString &)));
282 283

    if(l->exec() == QDialog::Accepted) {
284
	open(m_directoryQueue);
285 286 287
	for(QStringList::Iterator it = m_directoryQueue.begin(); it !=  m_directoryQueue.end(); it++)
	    m_dirWatch->addDir(*it, false, true);
	    
288
	m_directoryList += m_directoryQueue;
289 290 291

	QStringList::Iterator it = m_directoryQueueRemove.begin();
	for(; it !=  m_directoryQueueRemove.end(); it++) {
292
	    m_dirWatch->removeDir(*it);
293
	    m_directoryList.remove(*it);
294
	}
295 296
    }
}
297

298
Playlist *PlaylistSplitter::slotCreatePlaylist()
299 300 301
{
    bool ok;

302
    // If this text is changed, please also change it in PlaylistBox::duplicate().
303

Nadeem Hasan's avatar
Nadeem Hasan committed
304 305 306
    QString name = KLineEditDlg::getText(i18n("Create New Playlist"), 
	i18n("Please enter a name for the new playlist:"),
	uniquePlaylistName(), &ok);
307
    if(ok)
308
	return createPlaylist(name);
309
    else
310
	return 0;
311 312
}

313
void PlaylistSplitter::slotSelectPlaying()
314
{
315
    if(!m_playingItem)
316 317
	return;

318
    Playlist *l = static_cast<Playlist *>(m_playingItem->listView());
319
	
320 321
    if(!l)
	return;
322

323
    l->clearSelection();
324 325
    l->setSelected(m_playingItem, true);
    l->ensureItemVisible(m_playingItem);
Nadeem Hasan's avatar
Nadeem Hasan committed
326

327 328
    if(l != visiblePlaylist())
	m_playlistBox->raise(l);
329 330
}

331
void PlaylistSplitter::slotDeleteSelectedItems()
332 333 334
{
    Playlist *p = visiblePlaylist();
    if(p)
335
	p->slotDeleteSelectedItems();
336 337
}

338 339 340 341 342
void PlaylistSplitter::slotAddToPlaylist(const QString &file, Playlist *list)
{
    KApplication::setOverrideCursor(Qt::waitCursor);
    addImpl(file, list);
    KApplication::restoreOverrideCursor();
Nadeem Hasan's avatar
Nadeem Hasan committed
343

344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
    if(m_editor)
	m_editor->slotUpdateCollection();
}

void PlaylistSplitter::slotAddToPlaylist(const QStringList &files, Playlist *list)
{
    KApplication::setOverrideCursor(Qt::waitCursor);
    for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it)
        addImpl(*it, list);
    KApplication::restoreOverrideCursor();

    if(m_editor)
	m_editor->slotUpdateCollection();
}

359 360 361 362 363 364 365
void PlaylistSplitter::slotGuessTagInfo()
{
    visiblePlaylist()->slotGuessTagInfo();
    if(m_editor)
        m_editor->slotRefresh();
}

366 367 368 369 370 371 372
void PlaylistSplitter::slotRenameFile()
{
    visiblePlaylist()->slotRenameFile();
    if(m_editor)
        m_editor->slotRefresh();
}

373 374 375 376 377 378
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////

void PlaylistSplitter::setupLayout()
{
379
    m_playlistBox = new PlaylistBox(this, "playlistBox");
380 381 382 383 384 385

    // Create a splitter to go between the playlists and the editor.

    QSplitter *editorSplitter = new QSplitter(Qt::Vertical, this, "editorSplitter");

    // Create the playlist and the editor.
386
    
387 388
    m_playlistStack = new QWidgetStack(editorSplitter, "playlistStack");
    m_editor = new TagEditor(editorSplitter, "tagEditor");
389 390 391

    // Make the editor as small as possible (or at least as small as recommended)

392
    editorSplitter->setResizeMode(m_editor, QSplitter::FollowSizeHint);
393 394 395 396

    // Make the connection that will update the selected playlist when a 
    // selection is made in the playlist box.

397 398
    connect(m_playlistBox, SIGNAL(signalCurrentChanged(const PlaylistList &)), 
	    this, SLOT(slotChangePlaylist(const PlaylistList &)));
399

400
    connect(m_playlistBox, SIGNAL(signalDoubleClicked()), this, SIGNAL(signalListBoxDoubleClicked()));
401 402 403 404

    // Create the collection list; this should always exist.  This has a 
    // slightly different creation process than normal playlists (since it in
    // fact is a subclass) so it is created here rather than by using 
405
    // slotCreatePlaylist().
406

407
    CollectionList::initialize(m_playlistStack, m_restore);
408 409
    m_collection = CollectionList::instance();
    setupPlaylist(m_collection, true, "folder_sound");
410
    connect(m_collection, SIGNAL(signalCollectionChanged()), m_editor, SLOT(slotUpdateCollection()));
411 412
    connect(m_collection, SIGNAL(signalRequestPlaylistCreation(const QValueList<QFileInfo> &)), 
	    this, SLOT(slotCreatePlaylist(const QValueList<QFileInfo> &)));
413

414 415 416 417 418 419 420 421 422

    // Create the search widget -- this must be done after the CollectionList is created.
    m_searchWidget = new SearchWidget(editorSplitter, CollectionList::instance(), "searchWidget");
    editorSplitter->moveToFirst(m_searchWidget);
    connect(m_searchWidget, SIGNAL(signalQueryChanged(const QString &, bool)),
	    this, SLOT(slotShowSearchResults(const QString &, bool)));
    connect(CollectionList::instance(), SIGNAL(signalVisibleColumnsChanged()),
	    this, SLOT(slotVisibleColumnsChanged()));

423
    // Show the collection on startup.
424
    m_playlistBox->setSelected(0, true);
425 426 427 428
}

void PlaylistSplitter::readConfig()
{
429 430 431 432
    KConfig *config = KGlobal::config();
    { // block for Playlists group
	KConfigGroupSaver saver(config, "Playlists");

433 434 435 436 437 438 439
	QValueList<int> splitterSizes = config->readIntListEntry("PlaylistSplitterSizes");
	if(splitterSizes.isEmpty()) {
	    splitterSizes.append(100);
	    splitterSizes.append(640);
	}
	setSizes(splitterSizes);
	
440
	if(m_restore) {
441 442 443 444

	    QString playlistsFile = KGlobal::dirs()->saveLocation("appdata") + "playlists";

	    QFile f(playlistsFile);
Nadeem Hasan's avatar
Nadeem Hasan committed
445

446 447 448
	    if(f.open(IO_ReadOnly)) {
		QDataStream s(&f);
		while(!s.atEnd()) {
449
		    Playlist *p = new Playlist(m_playlistStack);
450 451 452 453
		    s >> *p;

		    // check to see if we've alredy loaded this item before continuing

454
		    if(p->fileName().isEmpty() || !m_playlistFiles.insert(p->fileName()))
455 456 457 458
			setupPlaylist(p);
		    else
			delete p;
		}
459
	    }
460

461
	    m_directoryList = config->readListEntry("DirectoryList");
462
	    QTimer::singleShot(0, this, SLOT(slotScanDirectories()));
463 464

	    m_dirWatch = new KDirWatch();
465 466
	    connect(m_dirWatch, SIGNAL(dirty(const QString &)), 
		    this, SLOT(slotDirChanged(const QString &)));
467

468 469
	    QStringList::Iterator it = m_directoryList.begin();
            for(; it != m_directoryList.end(); ++it)
470 471 472
		m_dirWatch->addDir(*it, false, true);

	    m_dirWatch->startScan();
473
	}
474 475 476

	// restore the list of hidden and shown columns

477
	if(m_collection) {
478
	    for(int i = 0; i < m_collection->columns(); i++)
479
		m_columnNames.append(m_collection->columnText(i));
480
	}
481

482
    }
483
}
484 485 486 487

void PlaylistSplitter::saveConfig()
{
    KConfig *config = KGlobal::config();
488

489
    // Save the list of open playlists.
Nadeem Hasan's avatar
Nadeem Hasan committed
490

491
    if(m_restore && m_playlistBox) {
492 493 494

	// Start at item 1.  We want to skip the collection list.

495 496 497 498 499 500 501
	QString playlistsFile = KGlobal::dirs()->saveLocation("appdata") + "playlists";
	QFile f(playlistsFile);
	
	if(f.open(IO_WriteOnly)) {

	    QDataStream s(&f);

502
	    PlaylistList l = m_playlistBox->playlists();
503

504 505
	    for(PlaylistList::Iterator it = l.begin(); it != l.end(); it++)
		s << *(*it);
506

507
	    f.close();
508 509 510
	}
	{ // block for Playlists group
	    KConfigGroupSaver saver(config, "Playlists");
511
	    config->writeEntry("DirectoryList", m_directoryList);
512
	    config->writeEntry("SortColumn", m_collection->sortColumn());
513
	    config->writeEntry("PlaylistSplitterSizes", sizes());
514 515
	}
    }
516 517
}

518 519 520 521 522 523 524 525 526 527 528 529 530
void PlaylistSplitter::addImpl(const QString &file, Playlist *list)
{
    processEvents();
    QFileInfo fileInfo(QDir::cleanDirPath(file));
    if(fileInfo.exists()) {
        if(fileInfo.isDir()) {
            QDir dir(fileInfo.filePath());
            QStringList dirContents=dir.entryList();
            for(QStringList::Iterator it = dirContents.begin(); it != dirContents.end(); ++it)
                if(*it != "." && *it != "..")
                    addImpl(fileInfo.filePath() + QDir::separator() + *it, list);
        }
        else {
531
            QString extension = fileInfo.extension(false).lower();
532
            if(m_mediaExtensions->contains(extension) > 0)
533
		list->createItem(fileInfo);
534
	    else if(m_listExtensions->contains(extension) > 0)
535 536
		openPlaylist(fileInfo.absFilePath());
        }
Nadeem Hasan's avatar
Nadeem Hasan committed
537
    }
538 539
}

540
void PlaylistSplitter::setupPlaylist(Playlist *p, bool raise, const char *icon)
541
{
542 543 544 545 546 547 548 549 550 551 552 553
    connect(p, SIGNAL(signalSelectionChanged(const PlaylistItemList &)),
	    m_editor, SLOT(slotSetItems(const PlaylistItemList &)));
    connect(p, SIGNAL(signalDoubleClicked()),
	    this, SIGNAL(signalDoubleClicked()));
    connect(p, SIGNAL(signalNumberOfItemsChanged(Playlist *)),
	    this, SLOT(slotPlaylistCountChanged(Playlist *)));
    connect(p, SIGNAL(signalAboutToRemove(PlaylistItem *)), 
	    this, SLOT(slotPlaylistItemRemoved(PlaylistItem *)));
    connect(p, SIGNAL(signalFilesDropped(const QStringList &, Playlist *)), 
	    this, SLOT(slotAddToPlaylist(const QStringList &, Playlist *)));
    connect(p, SIGNAL(signalSetNext(PlaylistItem *)),
	    this, SLOT(slotSetNextItem(PlaylistItem *)));
554

555 556
    if(icon)
	m_playlistBox->createItem(p, icon, raise);
557

558
    if(raise)
559
	m_playlistStack->raiseWidget(p);
560 561
}

562 563 564
Playlist *PlaylistSplitter::openPlaylist(const QString &file)
{
    QFileInfo fileInfo(file);
565 566 567 568 569
    if(!fileInfo.exists() || 
       !fileInfo.isFile() || 
       !fileInfo.isReadable() || 
       m_playlistFiles.insert(fileInfo.absFilePath()))
    {
570
	return 0;
571
    }
572

573
    Playlist *p = new Playlist(file, m_playlistStack, fileInfo.baseName(true).latin1());
574
    setupPlaylist(p);
575
    return p;
576 577
}

578 579 580 581 582 583 584
QString PlaylistSplitter::play(PlaylistItem *item)
{
    stop();

    if(!item)
	return QString::null;

585 586 587 588
    Playlist *p = static_cast<Playlist *>(item->listView());

    p->setPlaying(item, true);

589 590 591 592 593
    m_playingItem = item;

    return item->absFilePath();
}

594 595 596 597
////////////////////////////////////////////////////////////////////////////////
// private slots
////////////////////////////////////////////////////////////////////////////////

598
void PlaylistSplitter::slotChangePlaylist(const PlaylistList &l)
599
{
600
    if(l.isEmpty())
601
	return;
602

603 604
    Playlist *current = m_dynamicList;

605 606 607
    m_searchWidget->clear();

    m_nextPlaylistItem = 0;
608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
    if(l.count() == 1) {
	m_playlistStack->raiseWidget(l.first());
	m_editor->slotSetItems(playlistSelection());
	m_dynamicList = 0;
	emit signalPlaylistChanged();
    }
    else {
	m_dynamicList = new Playlist(m_playlistStack, i18n("Dynamic List"));
	setupPlaylist(m_dynamicList, true, 0);
	// unsorted...
	m_dynamicList->setSorting(m_dynamicList->columns() + 1);

	PlaylistItem *previous = 0;

	for(PlaylistList::ConstIterator it = l.begin(); it != l.end(); ++it) {
	    if(*it) {
		PlaylistItemList items = (*it)->items();
		for(PlaylistItemList::Iterator itemIt = items.begin(); itemIt != items.end(); ++itemIt)
		    previous = new PlaylistItem((*itemIt)->collectionItem(), m_dynamicList, previous);
	    }
	}
    }

    if(current)
	delete current;
633 634
}

635
void PlaylistSplitter::slotPlaylistCountChanged(Playlist *p)
636
{
637 638
    if(p && p == m_playlistStack->visibleWidget())
	emit signalSelectedPlaylistCountChanged(p->childCount());
639 640
}

641
void PlaylistSplitter::slotPlaylistItemRemoved(PlaylistItem *item)
642
{
643 644
    if(item == m_playingItem)
	m_playingItem = 0;
645 646 647

    if(item == m_nextPlaylistItem)
	m_nextPlaylistItem = 0;
648 649
}

650 651 652
void PlaylistSplitter::slotCreatePlaylist(const QValueList<QFileInfo> &fileInfos)
{
    Playlist *playlist = slotCreatePlaylist();
653
    if(!playlist)
654
        return;
655

656 657 658 659 660 661
    QValueList<QFileInfo>::ConstIterator it = fileInfos.begin();
    QValueList<QFileInfo>::ConstIterator end = fileInfos.end();
    for(; it != end; ++it)
        playlist->createItem(*it);
}

662 663 664 665 666 667 668 669 670 671
void PlaylistSplitter::slotShowSearchResults(const QString &query, bool caseSensitive)
{
    if(query.isEmpty()) {
	visiblePlaylist()->setItemsVisible(visiblePlaylist()->items(), true);
	return;
    }

    PlaylistList playlists;
    playlists.append(visiblePlaylist());

672
    PlaylistSearch::Component component(query, caseSensitive, m_searchWidget->searchedColumns(0));
673 674 675 676 677 678 679 680 681
    PlaylistSearch::ComponentList components;
    components.append(&component);

    PlaylistSearch search(playlists, components);

    Playlist::setItemsVisible(search.matchedItems(), true);    
    Playlist::setItemsVisible(search.unmatchedItems(), false);
}

682 683 684 685 686 687 688 689
void PlaylistSplitter::slotVisibleColumnsChanged()
{
    m_searchWidget->slotUpdateColumns();
    m_searchWidget->slotQueryChanged();
    if(m_searchWidget->searchedColumns(0).count() > 1)
	slotShowSearchResults(m_searchWidget->query(), m_searchWidget->caseSensitive());
}

690
#include "playlistsplitter.moc"
Nadeem Hasan's avatar
Nadeem Hasan committed
691 692

// vim:ts=8