~ubuntu-branches/ubuntu/karmic/kid3/karmic

« back to all changes in this revision

Viewing changes to kid3/kid3.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi
  • Date: 2009-05-20 16:12:30 UTC
  • mfrom: (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090520161230-qetp532r8ydujkz2
Tags: upstream-1.2
Import upstream version 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * \author Urs Fleisch
7
7
 * \date 9 Jan 2003
8
8
 *
9
 
 * Copyright (C) 2003-2008  Urs Fleisch
 
9
 * Copyright (C) 2003-2009  Urs Fleisch
10
10
 *
11
11
 * This file is part of Kid3.
12
12
 *
86
86
#include "frametable.h"
87
87
#include "configdialog.h"
88
88
#include "importdialog.h"
 
89
#include "browsecoverartdialog.h"
89
90
#include "exportdialog.h"
90
91
#include "numbertracksdialog.h"
91
92
#include "filterdialog.h"
92
93
#include "rendirdialog.h"
 
94
#include "downloaddialog.h"
93
95
#include "filelistitem.h"
94
96
#include "dirlist.h"
95
97
#include "pictureframe.h"
240
242
 * Constructor.
241
243
 */
242
244
Kid3App::Kid3App() :
243
 
        m_importDialog(0), m_exportDialog(0), m_renDirDialog(0),
244
 
        m_numberTracksDialog(0), m_filterDialog(0)
 
245
        m_downloadToAllFilesInDir(false),
 
246
        m_importDialog(0), m_browseCoverArtDialog(0),
 
247
        m_exportDialog(0), m_renDirDialog(0),
 
248
        m_numberTracksDialog(0), m_filterDialog(0), m_downloadDialog(0)
245
249
{
246
250
#ifdef CONFIG_USE_KDE
247
251
#if KDE_VERSION >= 0x035c00
260
264
#if !defined _WIN32 && !defined WIN32 && defined CFG_DATAROOTDIR
261
265
        QPixmap icon;
262
266
        if (icon.load(QString(CFG_DATAROOTDIR) +
263
 
                                                                "/icons/hicolor/48x48/apps/kid3-qt.png")) {
 
267
#ifndef __APPLE__
 
268
                                                                "/icons/hicolor/48x48/apps/kid3-qt.png"
 
269
#else
 
270
                                                                "/kid3.png"
 
271
#endif
 
272
                                )) {
264
273
                QCM_setWindowIcon(icon);
265
274
        }
266
275
#endif
306
315
        delete m_renDirDialog;
307
316
        delete m_numberTracksDialog;
308
317
        delete m_filterDialog;
 
318
        delete m_downloadDialog;
 
319
        delete m_browseCoverArtDialog;
309
320
#ifndef CONFIG_USE_KDE
310
321
        delete s_helpBrowser;
311
322
        s_helpBrowser = 0;
363
374
        fileSave->KCM_setStatusTip(i18n("Saves the changed files"));
364
375
        fileQuit->KCM_setStatusTip(i18n("Quits the application"));
365
376
        editSelectAll->KCM_setStatusTip(i18n("Select all files"));
 
377
#if KDE_VERSION >= 0x035c00
 
378
        editSelectAll->setShortcut(KShortcut("Alt+Shift+A"));
 
379
#else
366
380
        editSelectAll->setShortcut(KShortcut("Alt+A"));
 
381
#endif
367
382
        editDeselect->KCM_setStatusTip(i18n("Deselect all files"));
368
383
        settingsShortcuts->KCM_setStatusTip(i18n("Configure Shortcuts"));
369
384
        settingsToolbars->KCM_setStatusTip(i18n("Configure Toolbars"));
399
414
                    SLOT(slotImportMusicBrainz()), actionCollection(),
400
415
                    "import_musicbrainz");
401
416
#endif
 
417
        KCM_KAction(fileBrowseCoverArt,
 
418
                    i18n("&Browse Cover Art..."), this,
 
419
                    SLOT(slotBrowseCoverArt()), actionCollection(),
 
420
                    "browse_cover_art");
402
421
        KCM_KActionIcon(fileExport, KCM_ICON_document_export,
403
422
                    i18n("&Export..."), this,
404
423
                    SLOT(slotExport()), actionCollection(),
447
466
                            i18n("Hide Tag &2"), this,
448
467
                                                                SLOT(slotSettingsShowHideV2()), actionCollection(),
449
468
                                                                "hide_v2");
 
469
        KCM_KActionVar(m_settingsShowHidePicture,
 
470
                            i18n("Hide &Picture"), this,
 
471
                                                                SLOT(slotSettingsShowHidePicture()), actionCollection(),
 
472
                                                                "hide_picture");
450
473
 
451
474
        KCM_KActionShortcutIcon(editPreviousFile, KShortcut("Alt+Up"), KCM_ICON_go_previous,
452
475
                    i18n("&Previous File"), m_view,
590
613
                        this, SLOT(slotImportMusicBrainz()));
591
614
        }
592
615
#endif
 
616
        QAction* fileBrowseCoverArt = new QAction(this);
 
617
        if (fileBrowseCoverArt) {
 
618
                fileBrowseCoverArt->setStatusTip(i18n("Browse album cover artwork"));
 
619
                fileBrowseCoverArt->QCM_setMenuText(i18n("&Browse Cover Art..."));
 
620
                connect(fileBrowseCoverArt, QCM_SIGNAL_triggered,
 
621
                        this, SLOT(slotBrowseCoverArt()));
 
622
        }
593
623
        QAction* fileExport = new QAction(this);
594
624
        if (fileExport) {
595
625
                fileExport->setStatusTip(i18n("Export to file or clipboard"));
732
762
                connect(m_settingsShowHideV2, QCM_SIGNAL_triggered,
733
763
                        this, SLOT(slotSettingsShowHideV2()));
734
764
        }
 
765
        m_settingsShowHidePicture = new QAction(this);
 
766
        if (m_settingsShowHidePicture) {
 
767
                m_settingsShowHidePicture->setStatusTip(i18n("Hide Picture"));
 
768
                m_settingsShowHidePicture->QCM_setMenuText(i18n("Hide &Picture"));
 
769
                connect(m_settingsShowHidePicture, QCM_SIGNAL_triggered,
 
770
                        this, SLOT(slotSettingsShowHidePicture()));
 
771
        }
735
772
        QAction* settingsConfigure = new QAction(this);
736
773
        if (settingsConfigure) {
737
774
                settingsConfigure->setStatusTip(i18n("Configure Kid3"));
774
811
#ifdef HAVE_TUNEPIMP
775
812
                QCM_addAction(fileMenu, fileImportMusicBrainz);
776
813
#endif
 
814
                QCM_addAction(fileMenu, fileBrowseCoverArt);
777
815
                QCM_addAction(fileMenu, fileExport);
778
816
                QCM_addAction(fileMenu, fileCreatePlaylist);
779
817
                fileMenu->QCM_addSeparator();
798
836
 
799
837
                QCM_addAction(settingsMenu, m_settingsShowHideV1);
800
838
                QCM_addAction(settingsMenu, m_settingsShowHideV2);
 
839
                QCM_addAction(settingsMenu, m_settingsShowHidePicture);
801
840
                settingsMenu->QCM_addSeparator();
802
841
                QCM_addAction(settingsMenu, settingsConfigure);
803
842
 
925
964
        m_fileOpenRecent->saveEntries(m_config, "Recent Files");
926
965
#endif
927
966
#else
 
967
        s_miscCfg.m_windowX = x();
 
968
        s_miscCfg.m_windowY = y();
928
969
        s_miscCfg.m_windowWidth = size().width();
929
970
        s_miscCfg.m_windowHeight = size().height();
930
971
#endif
993
1034
#endif
994
1035
        updateHideV1();
995
1036
        updateHideV2();
 
1037
        updateHidePicture();
996
1038
#ifdef CONFIG_USE_KDE
997
1039
        setAutoSaveSettings();
998
1040
#if KDE_VERSION >= 0x035c00
1008
1050
        if (s_miscCfg.m_windowWidth != -1 && s_miscCfg.m_windowHeight != -1) {
1009
1051
                resize(s_miscCfg.m_windowWidth, s_miscCfg.m_windowHeight);
1010
1052
        }
 
1053
        if (s_miscCfg.m_windowX != -1 && s_miscCfg.m_windowY != -1) {
 
1054
                move(s_miscCfg.m_windowX, s_miscCfg.m_windowY);
 
1055
        }
1011
1056
#endif
1012
1057
        m_view->readConfig();
1013
1058
}
1669
1714
        QMessageBox::about(
1670
1715
                (Kid3App*)parent(), "Kid3",
1671
1716
                "Kid3 " VERSION
1672
 
                "\n(c) 2003-2008 Urs Fleisch\nufleisch@users.sourceforge.net");
 
1717
                "\n(c) 2003-2009 Urs Fleisch\nufleisch@users.sourceforge.net");
1673
1718
}
1674
1719
 
1675
1720
/**
1815
1860
        }
1816
1861
        slotStatusMsg(i18n("Ready."));
1817
1862
        QApplication::restoreOverrideCursor();
 
1863
 
 
1864
        if (destV2 && flt.isEnabled(Frame::FT_Picture) &&
 
1865
            !m_trackDataList.getCoverArtUrl().isEmpty()) {
 
1866
                downloadImage(m_trackDataList.getCoverArtUrl(), true);
 
1867
        }
1818
1868
}
1819
1869
 
1820
1870
/**
1929
1979
#endif
1930
1980
}
1931
1981
 
 
1982
/**
 
1983
 * Browse album cover artwork.
 
1984
 */
 
1985
void Kid3App::slotBrowseCoverArt()
 
1986
{
 
1987
        if (!m_browseCoverArtDialog) {
 
1988
                m_browseCoverArtDialog = new BrowseCoverArtDialog(0);
 
1989
        }
 
1990
        if (m_browseCoverArtDialog) {
 
1991
                FrameCollection frames2;
 
1992
                FileListItem* item;
 
1993
                TaggedFile* taggedFile;
 
1994
                if ((item = m_view->currentFile()) != 0 &&
 
1995
                                (taggedFile = item->getFile()) != 0) {
 
1996
                        taggedFile->readTags(false);
 
1997
                        FrameCollection frames1;
 
1998
                        taggedFile->getAllFramesV1(frames1);
 
1999
                        taggedFile->getAllFramesV2(frames2);
 
2000
                        frames2.merge(frames1);
 
2001
                }
 
2002
 
 
2003
                m_browseCoverArtDialog->readConfig();
 
2004
                m_browseCoverArtDialog->setFrames(frames2);
 
2005
                m_browseCoverArtDialog->exec();
 
2006
        }
 
2007
}
 
2008
 
1932
2009
#if defined HAVE_ID3LIB && defined HAVE_TAGLIB
1933
2010
/**
1934
2011
 * Read file with TagLib if it has an ID3v2.4 tag.
1981
2058
                                trackData.setFileExtension(taggedFile->getFileExtension());
1982
2059
                                trackData.setTagFormatV1(taggedFile->getTagFormatV1());
1983
2060
                                trackData.setTagFormatV2(taggedFile->getTagFormatV2());
 
2061
                                TaggedFile::DetailInfo info;
 
2062
                                taggedFile->getDetailInfo(info);
 
2063
                                trackData.setDetailInfo(info);
1984
2064
                                if (src == ExportDialog::SrcV1) {
1985
2065
                                        taggedFile->getAllFramesV1(trackData);
1986
2066
                                } else {
2096
2176
}
2097
2177
 
2098
2178
/**
 
2179
 * Show or hide the picture according to the settings and
 
2180
 * set the menu entries appropriately.
 
2181
 */
 
2182
void Kid3App::updateHidePicture()
 
2183
{
 
2184
        m_view->hidePicture(s_miscCfg.m_hidePicture);
 
2185
        if (s_miscCfg.m_hidePicture) {
 
2186
#ifdef CONFIG_USE_KDE
 
2187
                m_settingsShowHidePicture->setText(i18n("Show &Picture"));
 
2188
#else
 
2189
                m_settingsShowHidePicture->setStatusTip(i18n("Show Picture"));
 
2190
                m_settingsShowHidePicture->QCM_setMenuText(i18n("Show &Picture"));
 
2191
#endif
 
2192
 
 
2193
        } else {
 
2194
#ifdef CONFIG_USE_KDE
 
2195
                m_settingsShowHidePicture->setText(i18n("Hide &Picture"));
 
2196
#else
 
2197
                m_settingsShowHidePicture->setStatusTip(i18n("Hide Picture"));
 
2198
                m_settingsShowHidePicture->QCM_setMenuText(i18n("Hide &Picture"));
 
2199
#endif
 
2200
        }
 
2201
}
 
2202
 
 
2203
/**
2099
2204
 * Show or hide ID3v1.1 controls.
2100
2205
 */
2101
2206
void Kid3App::slotSettingsShowHideV1()
2114
2219
}
2115
2220
 
2116
2221
/**
 
2222
 * Show or hide picture.
 
2223
 */
 
2224
void Kid3App::slotSettingsShowHidePicture()
 
2225
{
 
2226
        s_miscCfg.m_hidePicture = !s_miscCfg.m_hidePicture;
 
2227
        updateHidePicture();
 
2228
#if QT_VERSION >= 0x040000
 
2229
        // In Qt3 the picture is displayed too small if Kid3 is started with picture
 
2230
        // hidden, and then "Show Picture" is triggered while a file with a picture
 
2231
        // is selected. Thus updating the controls is only done for Qt4, in Qt3 the
 
2232
        // file has to be selected again for the picture to be shown.
 
2233
        if (!s_miscCfg.m_hidePicture) {
 
2234
                updateGuiControls();
 
2235
        }
 
2236
#endif
 
2237
}
 
2238
 
 
2239
/**
2117
2240
 * Preferences.
2118
2241
 */
2119
2242
void Kid3App::slotSettingsConfigure()
2140
2263
                        if (!s_miscCfg.m_markTruncations) {
2141
2264
                                m_view->frameTableV1()->markRows(0);
2142
2265
                        }
 
2266
                        if (!s_miscCfg.m_markChanges) {
 
2267
                                m_view->frameTableV1()->markChangedFrames(0);
 
2268
                                m_view->frameTableV2()->markChangedFrames(0);
 
2269
                                m_view->markChangedFilename(false);
 
2270
                        }
2143
2271
                        setTextEncodings();
2144
2272
#if QT_VERSION < 0x040000
2145
2273
                        m_view->frameTableV1()->triggerUpdateGenres();
2157
2285
 */
2158
2286
void Kid3App::slotApplyFilenameFormat()
2159
2287
{
2160
 
        if (m_view->numFilesSelected() == 1) {
2161
 
                updateCurrentSelection();
2162
 
        }
 
2288
        updateCurrentSelection(true);
2163
2289
        FileListItem* mp3file = m_view->firstFile();
2164
2290
        bool no_selection = m_view->numFilesSelected() == 0;
2165
2291
        while (mp3file != 0) {
2181
2307
void Kid3App::slotApplyId3Format()
2182
2308
{
2183
2309
        FrameCollection frames;
2184
 
        if (m_view->numFilesSelected() == 1) {
2185
 
                updateCurrentSelection();
2186
 
        }
 
2310
        updateCurrentSelection(true);
2187
2311
        FrameFilter fltV1(m_view->frameTableV1()->getEnabledFrameFilter(true));
2188
2312
        FrameFilter fltV2(m_view->frameTableV2()->getEnabledFrameFilter(true));
2189
2313
        FileListItem* mp3file = m_view->firstFile();
2343
2467
 */
2344
2468
void Kid3App::numberTracks(int nr, bool destV1, bool destV2)
2345
2469
{
2346
 
        updateCurrentSelection();
 
2470
        updateCurrentSelection(true);
2347
2471
        FileListItem* mp3file = m_view->firstFileInDir();
2348
2472
        bool no_selection = m_view->numFilesSelected() == 0;
2349
2473
        while (mp3file != 0) {
2498
2622
void Kid3App::slotConvertToId3v24()
2499
2623
{
2500
2624
#ifdef HAVE_TAGLIB
2501
 
        if (m_view->numFilesSelected() == 1) {
2502
 
                updateCurrentSelection();
2503
 
        }
 
2625
        updateCurrentSelection(true);
2504
2626
        FileListItem* item = m_view->firstFile();
2505
2627
        while (item != 0) {
2506
2628
                TaggedFile* taggedFile;
2554
2676
void Kid3App::slotConvertToId3v23()
2555
2677
{
2556
2678
#if defined HAVE_TAGLIB && defined HAVE_ID3LIB
2557
 
        if (m_view->numFilesSelected() == 1) {
2558
 
                updateCurrentSelection();
2559
 
        }
 
2679
        updateCurrentSelection(true);
2560
2680
        FileListItem* item = m_view->firstFile();
2561
2681
        while (item != 0) {
2562
2682
                TaggedFile* taggedFile;
2621
2741
                QString dir = url.path().QCM_trimmed();
2622
2742
#endif
2623
2743
                if (dir.endsWith(".jpg", QCM_CaseInsensitive) ||
 
2744
                                dir.endsWith(".jpeg", QCM_CaseInsensitive) ||
2624
2745
                                dir.endsWith(".png", QCM_CaseInsensitive)) {
2625
2746
                        PictureFrame frame;
2626
2747
                        if (PictureFrame::setDataFromFile(frame, dir)) {
2632
2753
                                PictureFrame::setMimeTypeFromFileName(frame, fileName);
2633
2754
                                PictureFrame::setDescription(frame, fileName);
2634
2755
                                addFrame(&frame);
 
2756
                                updateGuiControls();
2635
2757
                        }
2636
2758
                } else {
2637
2759
                        updateCurrentSelection();
2651
2773
                PictureFrame frame;
2652
2774
                if (PictureFrame::setDataFromImage(frame, image)) {
2653
2775
                        addFrame(&frame);
2654
 
                }
 
2776
                        updateGuiControls();
 
2777
                }
 
2778
        }
 
2779
}
 
2780
 
 
2781
/**
 
2782
 * Download an image file.
 
2783
 *
 
2784
 * @param url           URL of image
 
2785
 * @param allFilesInDir true to add the image to all files in the directory
 
2786
 */
 
2787
void Kid3App::downloadImage(const QString& url, bool allFilesInDir)
 
2788
{
 
2789
        QString imgurl(BrowseCoverArtDialog::getImageUrl(url));
 
2790
        if (!imgurl.isEmpty()) {
 
2791
                if (!m_downloadDialog) {
 
2792
                        m_downloadDialog = new DownloadDialog(0, i18n("Download"));
 
2793
                        connect(m_downloadDialog, SIGNAL(downloadFinished(const QByteArray&, const QString&, const QString&)),
 
2794
                                                        this, SLOT(imageDownloaded(const QByteArray&, const QString&, const QString&)));
 
2795
                }
 
2796
                if (m_downloadDialog) {
 
2797
                        int hostPos = imgurl.QCM_indexOf("://");
 
2798
                        if (hostPos > 0) {
 
2799
                                int pathPos = imgurl.QCM_indexOf("/", hostPos + 3);
 
2800
                                if (pathPos > hostPos) {
 
2801
                                        m_downloadToAllFilesInDir = allFilesInDir;
 
2802
                                        m_downloadDialog->startDownload(
 
2803
                                                imgurl.mid(hostPos + 3, pathPos - hostPos - 3),
 
2804
                                                imgurl.mid(pathPos));
 
2805
                                        m_downloadDialog->exec();
 
2806
                                }
 
2807
                        }
 
2808
                }
 
2809
        }
 
2810
}
 
2811
 
 
2812
/**
 
2813
 * Handle URL on drop.
 
2814
 *
 
2815
 * @param txt dropped URL.
 
2816
 */
 
2817
void Kid3App::dropUrl(const QString& txt)
 
2818
{
 
2819
        downloadImage(txt, false);
 
2820
}
 
2821
 
 
2822
/**
 
2823
 * Add a downloaded image.
 
2824
 *
 
2825
 * @param data     HTTP response of download
 
2826
 * @param mimeType MIME type of data
 
2827
 * @param url      URL of downloaded data
 
2828
 */
 
2829
void Kid3App::imageDownloaded(const QByteArray& data,
 
2830
                              const QString& mimeType, const QString& url)
 
2831
{
 
2832
        if (mimeType.startsWith("image")) {
 
2833
                PictureFrame frame(data, url, PictureFrame::PT_CoverFront, mimeType);
 
2834
                if (m_downloadToAllFilesInDir) {
 
2835
                        FileListItem* mp3file = m_view->firstFileInDir();
 
2836
                        while (mp3file != 0) {
 
2837
                                TaggedFile* taggedFile = mp3file->getFile();
 
2838
                                taggedFile->readTags(false);
 
2839
                                taggedFile->addFrameV2(frame);
 
2840
                                mp3file = m_view->nextFileInDir();
 
2841
                        }
 
2842
                        m_downloadToAllFilesInDir = false;
 
2843
                } else {
 
2844
                        addFrame(&frame);
 
2845
                }
 
2846
                updateGuiControls();
2655
2847
        }
2656
2848
}
2657
2849
 
2681
2873
 
2682
2874
/**
2683
2875
 * Update files of current selection.
 
2876
 *
 
2877
 * @param onlyIfSingleFileSelected if true, the selection is only updated
 
2878
 *                                 if a single file is selected
2684
2879
 */
2685
 
void Kid3App::updateCurrentSelection()
 
2880
void Kid3App::updateCurrentSelection(bool onlyIfSingleFileSelected)
2686
2881
{
2687
2882
        int numFiles = 0;
2688
2883
        FileListItem* mp3file = m_view->firstFile();
2695
2890
                }
2696
2891
                mp3file = m_view->nextFile();
2697
2892
        }
 
2893
        if (onlyIfSingleFileSelected && numFiles != 1) {
 
2894
                return;
 
2895
        }
2698
2896
        if (numFiles > 0) {
2699
2897
                m_view->frameTableV1()->tableToFrames(numFiles > 1);
2700
2898
                m_view->frameTableV2()->tableToFrames(numFiles > 1);
2792
2990
                if (s_miscCfg.m_markTruncations) {
2793
2991
                        m_view->frameTableV1()->markRows(single_v2_file->getTruncationFlags());
2794
2992
                }
 
2993
                if (s_miscCfg.m_markChanges) {
 
2994
                        m_view->frameTableV1()->markChangedFrames(
 
2995
                                single_v2_file->getChangedFramesV1());
 
2996
                        m_view->frameTableV2()->markChangedFrames(
 
2997
                                single_v2_file->getChangedFramesV2());
 
2998
                        m_view->markChangedFilename(single_v2_file->isFilenameChanged());
 
2999
                }
 
3000
 
 
3001
                if (!s_miscCfg.m_hidePicture) {
 
3002
                        FrameCollection::const_iterator it =
 
3003
                                m_view->frameTableV2()->frames().find(Frame(Frame::FT_Picture, "", "", -1));
 
3004
                        if (it == m_view->frameTableV2()->frames().end()) {
 
3005
                                m_view->setPictureData(0);
 
3006
                        } else {
 
3007
                                QByteArray data;
 
3008
                                m_view->setPictureData(PictureFrame::getData(*it, data) ? &data : 0);
 
3009
                        }
 
3010
                }
2795
3011
        }
2796
3012
        else {
2797
3013
                m_view->setFilenameEditEnabled(false);
2802
3018
                if (s_miscCfg.m_markTruncations) {
2803
3019
                        m_view->frameTableV1()->markRows(0);
2804
3020
                }
 
3021
                if (s_miscCfg.m_markChanges) {
 
3022
                        m_view->frameTableV1()->markChangedFrames(0);
 
3023
                        m_view->frameTableV2()->markChangedFrames(0);
 
3024
                        m_view->markChangedFilename(false);
 
3025
                }
 
3026
                if (!s_miscCfg.m_hidePicture) {
 
3027
                        m_view->setPictureData(0);
 
3028
                }
2805
3029
        }
2806
3030
        m_view->frameTableV1()->setAllCheckBoxes(num_files_selected == 1);
2807
3031
        m_view->frameTableV1()->framesToTable();
2832
3056
 */
2833
3057
void Kid3App::copyTagsV1()
2834
3058
{
2835
 
        updateCurrentSelection();
 
3059
        updateCurrentSelection(true);
2836
3060
        m_copyTags = m_view->frameTableV1()->frames().copyEnabledFrames(
2837
3061
                m_view->frameTableV1()->getEnabledFrameFilter(true));
2838
3062
}
2842
3066
 */
2843
3067
void Kid3App::copyTagsV2()
2844
3068
{
2845
 
        updateCurrentSelection();
 
3069
        updateCurrentSelection(true);
2846
3070
        m_copyTags = m_view->frameTableV2()->frames().copyEnabledFrames(
2847
3071
                m_view->frameTableV2()->getEnabledFrameFilter(true));
2848
3072
}
2852
3076
 */
2853
3077
void Kid3App::pasteTagsV1()
2854
3078
{
2855
 
        updateCurrentSelection();
 
3079
        updateCurrentSelection(true);
2856
3080
        FrameCollection frames(m_copyTags.copyEnabledFrames(
2857
3081
                                                                                                         m_view->frameTableV1()->getEnabledFrameFilter(true)));
2858
3082
        formatFramesIfEnabled(frames);
2872
3096
 */
2873
3097
void Kid3App::pasteTagsV2()
2874
3098
{
2875
 
        updateCurrentSelection();
 
3099
        updateCurrentSelection(true);
2876
3100
        FrameCollection frames(m_copyTags.copyEnabledFrames(
2877
3101
                                                                                                         m_view->frameTableV2()->getEnabledFrameFilter(true)));
2878
3102
        formatFramesIfEnabled(frames);
2894
3118
 */
2895
3119
void Kid3App::getTagsFromFilenameV1()
2896
3120
{
2897
 
        updateCurrentSelection();
 
3121
        updateCurrentSelection(true);
2898
3122
        FrameCollection frames;
2899
3123
        FileListItem* mp3file = m_view->firstFile();
2900
3124
        bool multiselect = m_view->numFilesSelected() > 1;
2924
3148
 */
2925
3149
void Kid3App::getTagsFromFilenameV2()
2926
3150
{
2927
 
        updateCurrentSelection();
 
3151
        updateCurrentSelection(true);
2928
3152
        FrameCollection frames;
2929
3153
        FileListItem* mp3file = m_view->firstFile();
2930
3154
        bool multiselect = m_view->numFilesSelected() > 1;
2989
3213
 */
2990
3214
void Kid3App::copyV1ToV2()
2991
3215
{
2992
 
        updateCurrentSelection();
 
3216
        updateCurrentSelection(true);
2993
3217
        FrameCollection frames;
2994
3218
        FrameFilter flt(m_view->frameTableV2()->getEnabledFrameFilter(true));
2995
3219
        FileListItem* mp3file = m_view->firstFile();
3011
3235
 */
3012
3236
void Kid3App::copyV2ToV1()
3013
3237
{
3014
 
        updateCurrentSelection();
 
3238
        updateCurrentSelection(true);
3015
3239
        FrameCollection frames;
3016
3240
        FrameFilter flt(m_view->frameTableV1()->getEnabledFrameFilter(true));
3017
3241
        FileListItem* mp3file = m_view->firstFile();
3204
3428
                        if (m_framelist->selectFrame() &&
3205
3429
                                        m_framelist->addFrame(true)) {
3206
3430
                                updateAfterFrameModification(taggedFile);
 
3431
                                if (m_framelist->isPictureFrame()) {
 
3432
                                        // update preview picture
 
3433
                                        updateGuiControls();
 
3434
                                }
3207
3435
                        }
3208
3436
                } else {
3209
3437
                        m_framelist->setFrame(*frame);