Commit 67e61da3 authored by Michael Reeves's avatar Michael Reeves

Merge branch 'stable'

Conflicts:
	CMakeLists.txt
	src/CMakeLists.txt
	src/common.cpp
	src/difftextwindow.cpp
	src/directorymergewindow.cpp
	src/main.cpp
	src/mergeresultwindow.cpp
	src/optiondialog.cpp
parents 44c88c14 c46270b3
#!/bin/sh
#!/bin/bash
# Manually created configure
function showUsage {
printf "Usage: %s: [-d] [-o directory] [kde4|qt4] \n" $0
echo Example 1: $0 kde4
echo Example 2: $0 -d qt4
echo Options:
echo -d ... enable debug
echo -o \<dir\> ... specify other build directory
echo The default build directory is based on the specified arguments. E.g.: \"releaseKde\"
echo For requirements, more options and details in case of failure see the README.
exit 2
}
echo "configure for KDiff3 Qt4/KDE4 by Joachim Eibl"
config=release
outputDir=""
currentDir=`pwd`
while getopts do: flag
do
case $flag in
d) config="debug";;
o) outputDir="$OPTARG";;
?) showUsage;;
esac
done
if [ ! -z "$debug" ]; then
printf "Option -d specified\n"
fi
shift $(($OPTIND - 1))
#printf "Remaining arguments are: %s\n" "$*"
if [ "$1" = "kde4" ]; then
if [ "$outputDir" = "" ]; then
outputDir="${config}Kde"
fi
echo Trying to build for KDE4. If anything fails see the README for details.
echo Creating and entering subdir "release"
mkdir release # create sub directory
cd release
echo "Running cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`"
cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` # create Makefile
echo Creating and entering subdir "$outputDir"
mkdir "$outputDir" # create sub directory
cd "$outputDir"
echo "Running cmake \"$currentDir\" -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`"
if [ config = "debug" ]; then
cmake "$currentDir" -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=debugfull
else
cmake "$currentDir" -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` # create Makefile
fi
echo Running make.
make # run make (compile and link)
echo "If everything went OK then KDiff3 was built in the release-subdir."
echo If everything went OK then KDiff3 was built in the subdir "$outputDir".
echo "Install as root (requires password)."
sudo make install # install as root user
elif [ "$1" = "qt4" ]; then
if [ "$outputDir" = "" ]; then
outputDir="${config}Qt"
fi
echo Trying to build for Qt4 without KDE
echo "Entering subdir src-QT4"
cd src-QT4
echo "Running qmake kdiff3.pro"
qmake kdiff3.pro
echo Creating and entering subdir "$outputDir"
mkdir "$outputDir" # create sub directory
cd "$outputDir"
qmakecmd="qmake CONFIG+=$config \"$currentDir/src/kdiff3.pro\""
echo "Running $qmakecmd"
$qmakecmd
echo "Running make"
make
echo "If everything went OK then KDiff3 was built as src-QT4/kdiff3"
echo "If everything went OK then KDiff3 was built as $outputDir/kdiff3"
else
echo Usage 1: configure kde4
echo Usage 2: configure qt4
echo For requirements, more options and details in case of failure see the README.
showUsage
fi
......@@ -43,7 +43,7 @@ echo "Get files: $getFiles"
export LANG=en_US.UTF-8
# extract extra strings
xgettext --keyword=i18n --keyword=I18N_NOOP -C ../src-QT4/kreplacements/kreplacements.cpp -o kreplacements.pot
xgettext --keyword=i18n --keyword=I18N_NOOP -C ../src/kreplacements/kreplacements.cpp -o kreplacements.pot
sed -i /add_subdirectory/d CMakeLists.txt
if [ $getFiles -eq 1 ]; then
wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/subdirs -O subdirs
......
......@@ -19,7 +19,8 @@ set(kdiff3part_PART_SRCS
gnudiff_xmalloc.cpp
common.cpp
smalldialogs.cpp
progress.cpp )
progress.cpp
QUrlFix.cpp )
add_library(kdiff3part MODULE ${kdiff3part_PART_SRCS})
......
#include <QUrl>
#include "QUrlFix.h"
QUrlFix::QUrlFix(const QString &url):QUrl(url, TolerantMode)
{
if(this->scheme().isEmpty()) this->setScheme("file");//so QUrl:isLocalFile: works as expected on QT5.
}
#ifndef QT_NO_URL_CAST_FROM_STRING
QUrlFix& QUrlFix::operator =(const QString &url){
setUrl(url);
return *this;
}
#endif
void QUrlFix::setUrl(const QString &url){
QUrl::setUrl(url);
if(this->scheme().isEmpty()) this->setScheme("file");//so QUrl:isLocalFile: works as expected on QT5.
}
#ifndef QURLFIX_H
#define QURLFIX_H
#include <QUrl>
class QUrlFix:public QUrl{
public:
QUrlFix():QUrl(){};//make compiler shutup
QUrlFix(const QUrl &copy):QUrl(copy){};//make compiler shutup
QUrlFix(const QString &url);
void setUrl(const QString &url);
QUrlFix& operator =(const QString &url);
};
#endif
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -47,7 +47,8 @@ struct LineData
const QChar* pFirstNonWhiteChar;
int size;
LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/ bContainsPureComment=false; }
LineData(){ pLine=0; pFirstNonWhiteChar=0; size=0; /*occurances=0;*/
bContainsPureComment=false; }
int width(int tabSize) const; // Calcs width considering tabs.
//int occurances;
bool whiteLine() const { return pFirstNonWhiteChar-pLine == size; }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -76,7 +76,8 @@ public:
void getSelectionRange( int* firstLine, int* lastLine, e_CoordType coordType );
void setPaintingAllowed( bool bAllowPainting );
void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns );
void recalcWordWrap( bool bWordWrap, int wrapLineVectorSize, int nofVisibleColumns, ProgressProxy* );
void recalcWordWrapHelper( bool bWordWrap, int wrapLineVectorSize, int visibleTextWidth, int cacheListIdx, ProgressProxy* );
void print( MyPainter& painter, const QRect& r, int firstLine, int nofLinesPerPage );
Q_SIGNALS:
void resizeSignal( int nofVisibleColumns, int nofVisibleLines );
......
This diff is collapsed.
This diff is collapsed.
......@@ -17,7 +17,7 @@
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <QUrl>
#include "QUrlFix.h"
#include <list>
......@@ -29,7 +29,8 @@ class QFileInfo;
class ProgressProxyExtender: public ProgressProxy
{
Q_OBJECT
public:
ProgressProxyExtender() { setMaxNofSteps(100); }
public Q_SLOTS:
void slotListDirInfoMessage( KJob*, const QString& msg );
void slotPercent( KJob*, unsigned long percent );
......@@ -65,7 +66,7 @@ public:
QString fileName() const; // Just the name-part of the path, without parent directories
QString filePath() const; // The path-string that was used during construction
QString prettyAbsPath() const;
QUrl url() const;
QUrlFix url() const;
QString absoluteFilePath() const;
bool isLocal() const;
......
This diff is collapsed.
......@@ -29,6 +29,11 @@
#include <stdio.h>
#include <QString>
inline bool isEndOfLine( QChar c )
{
return c=='\n' || c=='\r' || c=='\x0b';
}
#define TAB_WIDTH 8
class GnuDiff
......
This diff is collapsed.
......@@ -35,48 +35,52 @@
#include "gnudiff_diff.h"
/* If non NULL, call this function when memory is exhausted. */
//void (*xalloc_fail_func) PARAMS ((void)) = 0;
void ( *xalloc_fail_func )( void ) = 0;
void GnuDiff::xalloc_die( void ) {
if( xalloc_fail_func )
( *xalloc_fail_func )();
//error (exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
/* The `noreturn' cannot be given to error, since it may return if
its first argument is 0. To help compilers understand the
xalloc_die does terminate, call exit. */
exit( EXIT_FAILURE );
void (*xalloc_fail_func)(void) = 0;
void GnuDiff::xalloc_die (void)
{
if (xalloc_fail_func)
(*xalloc_fail_func) ();
//error (exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
/* The `noreturn' cannot be given to error, since it may return if
its first argument is 0. To help compilers understand the
xalloc_die does terminate, call exit. */
exit (EXIT_FAILURE);
}
/* Allocate N bytes of memory dynamically, with error checking. */
void *
GnuDiff::xmalloc( size_t n ) {
void *p;
p = malloc( n == 0 ? 1 : n ); // There are systems where malloc returns 0 for n==0.
if( p == 0 )
xalloc_die();
return p;
GnuDiff::xmalloc (size_t n)
{
void *p;
p = malloc (n == 0 ? 1 : n); // There are systems where malloc returns 0 for n==0.
if (p == 0)
xalloc_die ();
return p;
}
/* Change the size of an allocated block of memory P to N bytes,
with error checking. */
void *
GnuDiff::xrealloc( void *p, size_t n ) {
p = realloc( p, n == 0 ? 1 : n );
if( p == 0 )
xalloc_die();
return p;
GnuDiff::xrealloc (void *p, size_t n)
{
p = realloc (p, n==0 ? 1 : n);
if (p == 0)
xalloc_die ();
return p;
}
/* Yield a new block of SIZE bytes, initialized to zero. */
void *
GnuDiff::zalloc( size_t size ) {
void *p = xmalloc( size );
memset( p, 0, size );
return p;
GnuDiff::zalloc (size_t size)
{
void *p = xmalloc (size);
memset (p, 0, size);
return p;
}
......@@ -181,8 +181,8 @@ KDiff3App::KDiff3App( QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff
pDialog->exec();
#if !defined(_WIN32) && !defined(Q_OS_OS2)
// A windows program has no console
fprintf( stderr, "%s\n", title.toLatin1().constData() );
fprintf( stderr, "%s\n", s.toLatin1().constData() );
printf( "%s\n", title.toLatin1().constData() );
printf( "%s\n", s.toLatin1().constData() );
#endif
exit( 1 );
}
......
......@@ -326,7 +326,7 @@ class KDiff3App : public QSplitter
KParts::MainWindow* m_pKDiff3Shell;
bool m_bAutoFlag;
bool m_bAutoMode;
void recalcWordWrap(int nofVisibleColumns=-1);
bool recalcWordWrap(int nofVisibleColumns=-1);
bool m_bRecalcWordWrapPosted;
void setHScrollBarRange();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -20,8 +20,16 @@
//////////////////////////////////////////////////////////////////////
#ifdef _WIN32
#include "stable.h"
#include <windows.h>
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8 ) /* Test for GCC > 4.8.0 */
#define INITGUID // needed for MinGW 4.8 otherwise IID_IContextMenu etc. produce undefined references during linking.
#include <guiddef.h>
#endif
#include <shlobj.h>
#include <shlguid.h>
#include <malloc.h>
//#include <QString>
//#include <QStringList>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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