File indexing completed on 2024-11-24 05:09:41

0001 /*
0002     SPDX-FileCopyrightText: 2001-2003 Otto Bruggeman <otto.bruggeman@home.nl>
0003     SPDX-FileCopyrightText: 2001-2003 John Firebaugh <jfirebaugh@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #include "info.h"
0009 
0010 using namespace KompareDiff2;
0011 
0012 Info::Info(Mode _mode,
0013            DiffMode _diffMode,
0014            Format _format,
0015            Generator _generator,
0016            const QUrl &_source,
0017            const QUrl &_destination,
0018            const QString &_localSource,
0019            const QString &_localDestination,
0020            QTemporaryDir *_sourceQTempDir,
0021            QTemporaryDir *_destinationQTempDir,
0022            uint _depth,
0023            bool _applied)
0024     : mode(_mode)
0025     , diffMode(_diffMode)
0026     , format(_format)
0027     , generator(_generator)
0028     , source(_source)
0029     , destination(_destination)
0030     , localSource(_localSource)
0031     , localDestination(_localDestination)
0032     , sourceQTempDir(_sourceQTempDir)
0033     , destinationQTempDir(_destinationQTempDir)
0034     , depth(_depth)
0035     , applied(_applied)
0036 {
0037 }
0038 
0039 void Info::swapSourceWithDestination()
0040 {
0041     QUrl url = source;
0042     source = destination;
0043     destination = url;
0044 
0045     QString string = localSource;
0046     localSource = localDestination;
0047     localDestination = string;
0048 
0049     QTemporaryDir *tmpDir = sourceQTempDir;
0050     sourceQTempDir = destinationQTempDir;
0051     destinationQTempDir = tmpDir;
0052 }