view kdiff3/doc/pt/index.docbook @ 74:069521efec1a

Updated KDiff3-installer-script for NSIS 2.16
author joachim99
date Sun, 14 May 2006 20:12:21 +0000
parents f7dad0aa6146
children 08ea9b86c12c
line wrap: on
line source
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
  <!ENTITY kdiff3 "<application
>KDiff3</application
>">
  <!ENTITY kappname "&kdiff3;">
  <!ENTITY package "extragear-utils">
  <!ENTITY % addindex "IGNORE">
  <!ENTITY % Portuguese "INCLUDE">
]>

<book lang="&language;">

<bookinfo>
<title
>O Manual do &kdiff3;</title>

<authorgroup>
<author
><personname
> <firstname
>Joachim</firstname
> <surname
>Eibl</surname
></personname
> <email
>joachim.eibl at gmx.de</email
> </author>
<othercredit role="translator"
><firstname
>Pedro</firstname
><surname
>Morais</surname
><affiliation
><address
><email
>morais@kde.org</email
></address
></affiliation
><contrib
>Tradução</contrib
></othercredit
> 

</authorgroup>

<copyright>
<year
>2002</year
><year
>2005</year>
<holder
>Joachim Eibl</holder>
</copyright>
<legalnotice
>&FDLNotice;</legalnotice>

<date
>2005-01-30</date>
<releaseinfo
>0.9.87</releaseinfo>

<abstract>
<para
>&kdiff3; is a file and directory diff and merge tool which: <itemizedlist>
<listitem
><para
>compara e junta dois ou três ficheiros de texto ou pastas de entrada,</para
></listitem>
<listitem
><para
>mostra as diferenças linha-a-linha e carácter-a-carácter(!),</para
></listitem>
<listitem
><para
>oferece uma funcionalidade de junção automática,</para
></listitem>
<listitem
><para
>tem um editor para resolver confortavelmente os conflitos de junção,</para
></listitem>
<listitem
><para
>oferece a transparência de rede através do KIO,</para
></listitem>
<listitem
><para
>tem opções para realçar ou esconder as alterações nos espaços em branco ou comentários,</para
></listitem>
<listitem
><para
>supports Unicode, UTF-8 and other file encodings.</para
></listitem>
</itemizedlist>
</para>
</abstract>

<keywordset>
<keyword
>KDE</keyword>
<keyword
>kdeextragear</keyword>
<keyword
>kdiff3</keyword>
<keyword
>diff</keyword>
<keyword
>juntar</keyword>
<keyword
>CVS</keyword>
<keyword
>'diff' triplo</keyword>
<keyword
>comparar</keyword>
<keyword
>ficheiros</keyword>
<keyword
>pastas</keyword>
<keyword
>controlo de versões</keyword>
<keyword
>junção-por-três-vias</keyword>
<keyword
>diferenças-nas-linhas</keyword>
<keyword
>sincronizar</keyword>
<keyword
>kpart</keyword>
<keyword
>kio</keyword>
<keyword
>transparente na rede</keyword>
<keyword
>editor</keyword>
<keyword
>espaços em branco</keyword>
<keyword
>comentários</keyword>
</keywordset>

</bookinfo>

<chapter id="introduction"
><title
>Introdução</title>
<sect1 id="why"
><title
>Outra Interface para o Diff?</title>
<para
>Existem várias ferramentas de detecção de diferenças. Porquê escolher o &kdiff3;? Deixe que o autor diga porque o escreveu.</para>

<para
>&kdiff3; started because I had to do a difficult merge. Merging is necessary when several people work on the same files in a project. A merge can be somewhat automated, when the merge-tool not only has the new modified files (called <quote
>branches</quote
>), but also the original file (called <quote
>base</quote
>). The merge tool will automatically choose any modification that was only done in one branch. When several contributors change the same lines, then the merge tool detects a conflict which must be solved manually.</para>

<para
>"A junção foi então difícil porque um dos colaboradores alterou várias coisas e corrigiu a indentação em vários sítios. Outro também alterou bastante texto, o que resultou em vários conflitos de junção".</para>

<para
>"A ferramenta que usei então só mostrava as linhas modificadas, mas não o que tinha sido alterado dentro dessas linhas. E não havia nenhuma informação sobre os locais em que só a indentação tinha sido alterada. A junção foi um pequeno pesadelo por isso".</para>

<para
>"Daí, foi este o início. A primeira versão podia mostrar as diferenças dentro de uma linha e mostrava as diferenças de espaços em branco. Depois, muitas outras funcionalidades foram adicionada para aumentar a utilidade".</para>

<para
>"Por exemplo, se você quiser comparar algum texto rapidamente, então poderá copiá-lo para a área de transferência e colá-lo noutra janela de diferenças".</para>

<para
>"Uma funcionalidade que necessitou de um grande esforço foi a comparação de pastas e a funcionalidade de junção, o que transformou o programa quase num navegador de ficheiros completo".</para>

<para
>Espero que o &kdiff3; funcione para si também. Divirta-se!</para>

<para
>Joachim Eibl (2003)</para>
</sect1>

<sect1 id="screenshots"
><title
>Imagens e Funcionalidades</title>
<para
>Esta imagem mostra a diferença entre dois ficheiros de texto</para>
<para
>(A usar uma versão anterior do &kdiff3;):</para>
<screenshot
><mediaobject>
   <imageobject
><imagedata fileref="screenshot_diff.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>

<para
>3-way-merging is fully supported. This is useful if two people change code independently.</para>
<para
>The original file (the base) is used to help &kdiff3; to automatically select the correct changes.</para>
<para
>The merge-editor below the diff-windows allows you to solve conflicts, while showing you the output you will get.</para>
<para
>You can even edit the output.</para>

<para
>This screenshot shows three input files being merged:</para>

<screenshot
><mediaobject>
   <imageobject
><imagedata fileref="screenshot_merge.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>

<para id="dirmergebigscreenshot"
>O &kdiff3; também o ajuda a comparar e a juntar pastas completas. Esta imagem mostra o &kdiff3; durante a junção de pastas:</para>

<screenshot
><mediaobject>
   <imageobject
><imagedata fileref="dirmergebig.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>

</sect1>

<sect1 id="features"
><title
>Mais Funcionalidades</title>
<sect2
><title
>Visualizador de Diferenças Linha-a-Linha e Carácter-a-Carácter</title>

<para
>Usando as possibilidades de um ambiente gráfico a cores, o &kdiff3; mostra exactamente o que é a diferença. Quando tiver de fazer várias revisões de código, irá gostar disto.</para>

<screenshot
><mediaobject>
   <imageobject
><imagedata fileref="letter_by_letter.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>
</sect2>

<sect2
><title
>Ver as Diferenças de Espaços em Branco de uma Vez</title>
<para
>Os espaços e as tabulações que são diferentes aparecem visivelmente. Quando as linhas diferem apenas pelo número de espaços em branco, isto poderá ser visto num instante se olhar para a coluna do resumo do lado esquerdo. (Não há mais problemas quando as pessoas mudam a indentação). </para>

<screenshot
><mediaobject>
   <imageobject
><imagedata fileref="white_space.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>
</sect2>

<sect2
><title
>Diferenças Triplas</title>
<para
>Analise três ficheiros e veja no que eles diferem. </para
><para
>As janelas da esquerda/meio/direita são intituladas A/B/C e têm as cores azul/verde/magenta, respectivamente. </para
><para
>Se um dos ficheiros for igual e o outro for diferente numa linha, então a cor mostra qual o ficheiro que é diferente. A cor vermelha indica que ambos os ficheiros são diferentes. </para>
<screenshot
><mediaobject>
   <imageobject
><imagedata fileref="triple_diff.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>
</sect2>

<sect2
><title
>Junção Confortável de Dois ou Três Ficheiros de Entrada</title>
<para
>O &kdiff3; pode ser usado para juntar dois ou três ficheiros de entrada e junta automaticamente o máximo possível. O resultado é apresentado numa janela editável em que a maioria dos conflitos poderá ser resolvida com um simples 'click' do rato: Seleccione os botões A/B/C na barra de botões para seleccionar a origem que deverá ser usada. Dado que esta janela de resultado é um editor, até mesmo os conflitos que necessitem de mais correcções poderão ser resolvidos aqui sem necessitarem de outra ferramenta. </para>
</sect2>

<sect2
><title
>E ...</title>
<itemizedlist>
   <listitem
><para
>Navegação rápida através de botões.</para
></listitem>
   <listitem
><para
>Um 'click' do rato numa coluna de resumo sincroniza todas as janelas para mostrarem a mesma posição.</para
></listitem>
   <listitem
><para
>Seleccionar e copiar de qualquer janela para colar na janela do resultado da junção.</para
></listitem>
   <listitem
><para
>Uma coluna de visão geral que mostra onde estão as alterações e os conflitos.</para
></listitem>
   <listitem
><para
>As cores são ajustáveis de acordo com as suas preferências específicas.</para
></listitem>
   <listitem
><para
>Um tamanho de tabulação ajustável.</para
></listitem>
   <listitem
><para
>Uma opção para inserir espaço em vez de tabulações.</para
></listitem>
   <listitem
><para
>Abertura confortável dos ficheiros através de uma janela ou da linha de comandos.</para
></listitem>
   <listitem
><para
>Search for strings in all text windows. Find (<keycombo
>&Ctrl;<keycap
>F</keycap
></keycombo
>) and Find Next (<keycap
>F3</keycap
>)</para
></listitem>
   <listitem
><para
>Mostrar os números de linha para cada linha. </para
></listitem>
   <listitem
><para
>Colar o conteúdo da área de transferência e arrastar o texto para uma janela de introdução de diferenças.</para
></listitem>
   <listitem
><para
>Transparência na rede através do KIO.</para
></listitem>
   <listitem
><para
>Pode ser usado como visualizador de diferenças no KDevelop 3.</para
></listitem>
   <listitem
><para
>Mudança de linha para as linhas compridas para as repartir.</para
></listitem>
   <listitem
><para
>Suporte para o Unicode, UTF-8 e outras codificações.</para
></listitem>
   <listitem
><para
>Suporte para as línguas escritas da direita-para-esquerda.</para
></listitem>
</itemizedlist>
</sect2>
</sect1>
</chapter>

<chapter id="documentation"
><title
>Documentation of File Comparison And Merge</title>

<sect1 id="commandline"
><title
>Opções da Linha de Comandos</title>

<sect2
><title
>Comparar 2 ficheiros: </title>
<screen
><command
>kdiff3</command
> <replaceable
>ficheiro1 ficheiro2</replaceable
></screen>
</sect2>

<sect2
><title
>Juntar 2 ficheiros: </title>
<screen
><command
>kdiff3</command
> <replaceable
>file1 file2</replaceable
> <option
>-m</option>
<command
>kdiff3</command
> <replaceable
>file1 file2</replaceable
> <option
>-o</option
> <replaceable
>outputfile</replaceable
></screen>
</sect2>

<sect2
><title
>Comparar 3 ficheiros: </title>
<screen
><command
>kdiff3</command
> <replaceable
>ficheiro1 ficheiro2 ficheiro3</replaceable
></screen>
</sect2>

<sect2
><title
>Juntar 3 ficheiros: </title>
<screen
><command
>kdiff3</command
> <replaceable
>file1 file2 file3</replaceable
> <option
>-m</option>
<command
>kdiff3</command
> <replaceable
>file1 file2 file3</replaceable
> <option
>-o</option
> <replaceable
>outputfile</replaceable
></screen>
<para
>Repare que o <replaceable
>ficheiro1</replaceable
> será tratado como base para o <replaceable
>ficheiro2</replaceable
> e o <replaceable
>ficheiro3</replaceable
>. </para>
</sect2>

<sect2
><title
>Caso especial: Ficheiros com o mesmo nome </title>
<para
>If all files have the same name but are in different directories, you can reduce typework by specifying the filename only for the first file. &eg;: </para>
<screen
><command
>kdiff3</command
> <replaceable
>pasta1/ficheiro pasta2 pasta3</replaceable
></screen>
</sect2>

<sect2
><title
>Linha de comandos para iniciar uma comparação ou junção de pastas: </title>
<para
>É bastante semelhante, mas diz respeito agora apenas às pastas.</para>
<screen
><command
>kdiff3</command
> <replaceable
>dir1 dir2</replaceable>
<command
>kdiff3</command
> <replaceable
>dir1 dir2</replaceable
> <option
>-o</option
> <replaceable
>destdir</replaceable>
<command
>kdiff3</command
> <replaceable
>dir1 dir2 dir3</replaceable>
<command
>kdiff3</command
> <replaceable
>dir1 dir2 dir3</replaceable
> <option
>-o</option
> <replaceable
>destdir</replaceable
>
</screen>
<para
>Para a comparação e junção de pastas, poderá continuar a ler <link linkend="dirmerge"
>aqui</link
>.</para>
</sect2>

<sect2
><title
>For more information on command line options use: </title>
<screen
><command
>kdiff3</command
> <option
>--help</option>
<computeroutput
>Options:
  -m, --merge               Merge the input.
  -b, --base file           Explicit base file. For compatibility with certain tools.
  -o, --output file         Output file. Implies -m. E.g.: -o newfile.txt
  --out file                Output file, again. (For compatibility with certain tools.)
  --auto                    No GUI if all conflicts are auto-solvable. (Needs -o file)
  --qall                    Don't solve conflicts automatically. (For compatibility...)
  --L1 alias1               Visible name replacement for input file 1 (base).
  --L2 alias2               Visible name replacement for input file 2.
  --L3 alias3               Visible name replacement for input file 3.
  -L, --fname alias         Alternative visible name replacement. Supply this once for every input.
  -u                        Has no effect. For compatibility with certain tools.</computeroutput
></screen>
</sect2>

</sect1>

<sect1 id="opendialog"
><title
>Janela de Abertura</title>
<para
>Dado que é necessário seleccionar vários ficheiros, o programa tem uma janela de abertura especial: </para>
<screenshot
><mediaobject>
<imageobject
><imagedata fileref="open_dialog.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>
<para
>The open dialog allows to edit the filenames by hand, selecting a file via the file-browser (<guilabel
>File...</guilabel
>) or allows to choose recent files from the drop-down lists. If you open the dialog again, then the current names still remain there. The third input file is not required. If the entry for <quote
>C</quote
> remains empty, then only a two file diff analysis will be done. </para
><para
>You can also select a directory via <guilabel
>Dir...</guilabel
>. If for A a directory is specified then a directory-comparison/merge starts. If A specifies a file but B, C or the output specify a directory, then &kdiff3; uses the filename from A in the specified directories. </para
><para
>If <guilabel
>Merge</guilabel
> is selected, then the <guilabel
>Output</guilabel
> line becomes editable. But it is not required to specify the output filename immediately. You can also postpone this until saving. </para
><para
>The <guibutton
>Configure...</guibutton
> button opens the options-dialog, so that you can set the options before running the analysis. </para>
</sect1>

<sect1 id="pasteinput"
><title
>Colar e Arrastar Dados</title>
<para
>Sometimes you want to compare parts of a text that is not an own file. &kdiff3; also allows you to paste text from the clipboard into the diff input window that has the focus. The diff analysis happens immediately then. In the open dialog you need not specify files then, but just close it via <guibutton
>Cancel</guibutton
>. </para
><para
>O utilizador também poderá usar o 'drag and drop': Arraste um ficheiro de um gestor de ficheiros ou o texto seleccionado de um editor e arrastá-lo para uma janela de introdução de diferenças. </para
><para
>Qual é a ideia? Algumas vezes um ficheiro contém duas funções semelhantes, mas a verificação sobre as semelhanças entre elas é um grande esforço, se você precisar de criar primeiro dois ficheiros e depois carregá-los. Assim, poderá simplesmente copiar, colar e comparar as secções relevantes. </para>
<note
><para
>Currently you can't drag anything from &kdiff3;. Only dropping in the diff input is supported. </para
></note>
<warning
><para
>Some editors still interpret the drag and drop into another program like cut (instead of copy) and paste. Your original data might be lost then. </para
></warning>
</sect1>

<sect1 id="interpretinginformation"
><title
>Interpreting The Information In The Input Windows</title>
<screenshot
><mediaobject>
<imageobject
><imagedata fileref="screenshot_diff.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>
<para
>At the top of each text window is its <quote
>info line</quote
>. The info lines of the input windows contain a letter <guilabel
>A</guilabel
>, <guilabel
>B</guilabel
> or <guilabel
>C</guilabel
>, the filename and the line number of the first visible line in the window. (Note that window <guilabel
>C</guilabel
> is optional.) Each info line appears in a different color. (If the paths are too long to fit, then you can move the mouse onto the info line and a tooltip will show the complete name.) </para
><para
>The three input windows are assigned the letters <guilabel
>A</guilabel
>, <guilabel
>B</guilabel
> and <guilabel
>C</guilabel
>. <guilabel
>A</guilabel
> has color blue, <guilabel
>B</guilabel
> has green and <guilabel
>C</guilabel
> has magenta. (These are the defaults, but can be changed in the <guimenu
>Settings</guimenu
> menu.) </para
><para
>When a difference is detected then the color shows which input file differs. When both other input files differ then the color used to express this is red by default (<guilabel
>Conflict color</guilabel
> in the settings). This colorscheme is especially useful in the case of three input files, which will be seen in the next section (<link linkend="merging"
>Merging</link
>). </para
><para
>Left of each text is the <quote
>summary column</quote
>. If differences occurred on a line then the summary column shows the respective color. For a white-space-only difference the summary is chequered. For programming languages where white space is not so important this is useful to see at one glance if anything of importance was modified. (In C/C++ white space is only interesting within strings, comments, for the preprocessor, and some only very esoteric situations.) </para
><para
>A linha vertical que separa a coluna do resumo e o texto é interrompida (tracejada), se o ficheiro de entrada não tiver aí nenhuma linha. Quando a mudança de linha estiver activa, então esta linha vertical aparece ponteada para as linhas repartidas. </para
><para
>On the right side a <quote
>overview</quote
> column is visible left of the vertical scrollbar. It shows the compressed summary column of input <guilabel
>A</guilabel
>. All the differences and conflicts are visible at one glance. When only two input windows are used, then all differences appear red here because every difference is also a conflict. A black rectangle frames the visible part of the inputs. For very long input files, when the number of input lines is bigger than the height of the overview column in pixels, then several input lines share one overview line. A conflict then has top priority over simple differences, which have priority over no change, so that no difference or conflict is lost here. By clicking into this overview column the corresponding text will be shown. </para>
</sect1>


<sect1 id="merging"
><title
>Juntar e a Janela do Editor do Resultado da Junção</title>
<screenshot
><mediaobject>
<imageobject
><imagedata fileref="screenshot_merge.png" format="PNG"/></imageobject>
</mediaobject
></screenshot>
<para
>The merge output editor window (below the diff input windows) also has an info line at the top showing <guilabel
>Output:</guilabel
>, the filename and <guilabel
>[Modified]</guilabel
> if you edited something. Usually it will contain some text through the automatic merge facilities, but often it will also contain conflicts. </para
><para
>Saving is disabled until all conflicts are resolved. (Use the <guibutton
>Go to prev/next unsolved conflicts</guibutton
> buttons to find the remaining conflicts.) </para
><para
>Com apenas dois ficheiros de entrada, todas as diferenças são também conflitos que necessitam de ser resolvidos manualmente. </para
><para
>Com três ficheiros de entrada, o primeiro ficheiro é tratado como a base, enquanto que o segundo e o terceiro contêm as modificações. Quando, em qualquer linha, só o ficheiro B ou o C tiverem sido alterados mas não ambos, então será seleccionada a origem alterada. Só quando o B e o C alteraram as mesmas linhas é que a ferramenta detecta um conflito que deverá ser resolvido manualmente. Quando o B e o C são iguais mas não são o mesmo que o A, é seleccionado o C. </para
><para
>The merge output editor window also has a summary column on the left. It shows the letter of the input from which a line was selected or nothing if all three sources where equal on a line. For conflicts it shows a questionmark <guilabel
>?</guilabel
> and the line shows <guilabel
>&lt;Merge Conflict&gt;</guilabel
>, all in red. Because solving conflicts line by line would take very long, the lines are grouped into groups that have the same difference and conflict characteristics. But only-white-space-conflicts are separated from non-white-space-conflicts in order to ease the merging of files were the indentation changed for many lines. </para
><para
>When clicking into the summary column with the left mouse button in either window then the group belonging to that line will be selected in all windows and the beginning of that group will be shown. (This might involve an automatic position jump in the windows if the beginning of a group is not visible.) This group then becomes the <quote
>current group</quote
>. It is highlighted with the <quote
>Current range (diff) background color</quote
> and a black bar appears on the left side of the text. </para
><para
>Note the input selector buttons containing the letters <guibutton
>A</guibutton
>, <guibutton
>B</guibutton
> and <guibutton
>C</guibutton
> in the button bar below the menu bar. When clicking on either input selector button, the lines from that input will be added at the end of the selected group if that group didn't contain that source before. Otherwise the lines from that input will be removed. </para
><para
>Besides, you can directly edit any line. The summary column will show <guibutton
>m</guibutton
> for every line that was modified. </para
><para
>Sometimes, when a line is removed either by automatic merge or by editing and no other lines remain in that group, then the text <computeroutput
>&lt;No src line&gt;</computeroutput
> will appear in that line. This is just a placeholder for the group for when you might change your mind and select some source again. This text won't appear in the saved file or in any selections you want to copy and paste. </para
><para
>The text <quote
>&lt;Merge Conflict&gt;</quote
> will appear in the clipboard if you copy and paste some text containing such a line. </para
><para
>The normal merge will start by solving simple conflicts automatically. But the <guimenu
>Merge</guimenu
> menu provides some actions for other common needs. If you have to select the same source for most conflicts, then you can choose <quote
>A</quote
>, <quote
>B</quote
> or <quote
>C</quote
> everywhere, or only for the remaining unsolved conflicts, or for unsolved whitespace conflicts. If you want to decide every single delta yourself, you can <guilabel
>Set deltas to conflicts</guilabel
>. Or if you want to return to the automatic choices of &kdiff3; then select <quote
>Automatically solve simple conflicts</quote
>. &kdiff3; then restarts the merge. For actions that change your previous modifications KDiff3 will ask for your confirmation before proceeding. </para>

<note
><para
>When choosing either source for unsolved whitespace conflicts and the options <guilabel
>Ignore Numbers</guilabel
> or <guilabel
>Ignore C/C++ Comments</guilabel
> are used then changes in numbers or comments will be treated like whitespace too. </para
></note>
</sect1>

<sect1 id="navigation"
><title
>Navegação e Edição</title>
<para
>Much navigation will be done with the scroll bars and the mouse but you can also navigate with the keys. If you click into either window then you can use the cursor buttons <keycap
>Left Arrow</keycap
>, <keycap
>Right Arrow</keycap
>, <keycap
>Up Arrow</keycap
>, <keycap
>Down Arrow</keycap
>, <keycap
>Page Up</keycap
>, <keycap
>Page Down</keycap
>, <keycap
>Home</keycap
>, <keycap
>End</keycap
>, <keycombo action="simul"
>&Ctrl;<keycap
>Home</keycap
></keycombo
>, <keycombo action="simul"
>&Ctrl;<keycap
>End</keycap
></keycombo
> as you would in other programs. The overview-column next to the vertical scroll bar of the input files can also be used for navigating by clicking into it. </para
><para
>You can also use a wheel mouse to scroll up and down. </para
><para
>In the merge output editor you can also use the other keys for editing. You can toggle between insert and overwrite mode with the <keycap
>Insert</keycap
> key. (Default is insert-mode.) </para
><para
>A &LMB; click into any summary column will synchronise all windows to show the beginning of the same group of lines (as explained in section <link linkend="merging"
>"Merging"</link
>). </para
><para
>The button bar also contains seven navigation buttons with which you can jump to the current/first/last difference, to the next/previous difference (<keycombo action="simul"
>&Ctrl;<keycap
>Down Arrow</keycap
></keycombo
>/<keycombo action="simul"
>&Ctrl;<keycap
>Up Arrow</keycap
></keycombo
>), to the next/previous conflict (<keycombo action="simul"
>&Ctrl;<keycap
>Page Down</keycap
></keycombo
>/<keycombo action="simul"
>&Ctrl;<keycap
>Page Up</keycap
></keycombo
>), or to the next/previous unsolved conflict. Note that for &kdiff3; a <quote
>conflict</quote
> that was not automatically solved at the start of the merge stays a <quote
>conflict</quote
> even if it is solved. Hence the necessity to distinguish <quote
>unsolved conflicts</quote
>. </para
><para
>There also is a button <guibutton
>Automatically go to next unsolved conflict after source selection</guibutton
> (Auto-Advance). If you enable this, then, when one source is selected, then &kdiff3; will jump to and select the next unsolved conflict automatically. This can help when you always want to choose one source only. When you need both sources, or you want to edit after selecting, then you probably want to switch this off. Before proceeding to the next unsolved conflict &kdiff3; shows you the effect of your choice for a short time. This delay is adjustable in the Diff &amp; Merge Settings: You can specify the <guilabel
>Auto-Advance delay</guilabel
> in milli seconds between 0 and 2000.</para>
<tip
><para
>Tired of many clicks? Use a small Auto-Advance-delay and the shortcuts <keycombo action="simul"
>&Ctrl;<keycap
>1</keycap
></keycombo
>, <keycombo action="simul"
>&Ctrl;<keycap
>2</keycap
></keycombo
> and <keycombo action="simul"
>&Ctrl;<keycap
>3</keycap
></keycombo
> to select files A, B or C for many conflicts.</para
></tip>
</sect1>

<sect1 id="selections"
><title
>Seleccionar, Copiar e Colar</title>
<para
>The input windows don't show a cursor, so selections must be made with the mouse by clicking with the &LMB; at the start, holding down the mousebutton and moving to the end, where you release the mouse button again. You can also select a word by double clicking it. In the merge output editor you can also select via the keyboard by holding the &Shift; button and navigation with the cursor keys. </para
><para
>To copy to the clipboard you must press the <guibutton
>Copy</guibutton
> button (<keycombo action="simul"
>&Ctrl;<keycap
>C</keycap
></keycombo
> or <keycombo action="simul"
>&Ctrl;<keycap
>Insert</keycap
></keycombo
>). But there exists an option <quote
>Auto Copy Selection</quote
>. If this is enabled, then whatever you select is copied immediately and you don't need to explicitly copy. But pay attention when using this because the contents of the clipboard might then be destroyed accidentally. </para
><para
><guimenuitem
>Cut</guimenuitem
> (<keycombo action="simul"
>&Ctrl;<keycap
>X</keycap
></keycombo
> or <keycombo action="simul"
>&Shift;<keycap
>Delete</keycap
></keycombo
>) copies to the clipboard and deletes the selected text and <guimenuitem
>Paste</guimenuitem
> (<keycombo action="simul"
>&Ctrl;<keycap
>V</keycap
></keycombo
> or <keycombo action="simul"
>&Shift;<keycap
>Insert</keycap
></keycombo
>) inserts the text in the clipboard at the cursor position or over the current selection. </para>
</sect1>

<sect1 id="saving"
><title
>Gravar</title>
<para
>Saving will only be allowed, when all conflicts were solved. If the file already exists and the <quote
>Backup files</quote
> option is enabled then the existing file will be renamed with an <filename role="extension"
>.orig</filename
> extension, but if such a file exists it will be deleted. When you exit or start another diff-analysis and data wasn't saved yet, then &kdiff3; will ask if you want to <guibutton
>Save</guibutton
>, <guibutton
>Cancel</guibutton
> or <guibutton
>Proceed without saving</guibutton
>. &kdiff3; does not catch any signals. So if you <quote
>kill</quote
> &kdiff3; then your data will be lost.) </para
><para
>Line endings are saved according to the normal method on the underlying operating system. For Unices each line ends with an linefeed-character <literal
>\n</literal
>, while for &Windows; based systems each line ends with a carriage-return + a linefeed <literal
>\r\n</literal
>. &kdiff3; does not preserve the line-endings of the input files, which also means that you shouldn't use &kdiff3; with binary files. </para>
</sect1>

<sect1 id="find"
><title
>Procurar Sequências de Texto</title>
<para
>You can search for a string in any text-window of &kdiff3;. The <guimenuitem
>Find ...</guimenuitem
> command (<keycombo action="simul"
>&Ctrl;<keycap
>F</keycap
></keycombo
>) in the <guimenu
>Edit</guimenu
> menu opens a dialog that lets you specify the string to search for. You can also select the windows which should be searched. Searching will always start at the top. Use the <guimenuitem
>Find Next</guimenuitem
> command (<keycap
>F3</keycap
>) to proceed to the next occurence. If you select to search several windows then the first window will be searched from top to bottom before the search starts in the next window at the top again, &etc; </para>
</sect1>


<sect1 id="options"
><title
>Opções</title>
<para
>Options and the recent-file-list will be saved when you exit the program, and reloaded when you start it. (Menu <menuchoice
><guimenu
>Settings</guimenu
><guimenuitem
>Configure KDiff3</guimenuitem
></menuchoice
> ...) </para>
<sect2
><title
>Tipo de Letra</title>
<para
>Seleccione um tipo de letra monoespaçado. (Em alguns sistemas, esta janela irá também apresentar os tipos de letra de tamanho variável, mas você não os deverá usar.) </para>
<variablelist>
   <varlistentry
><term
><guilabel
>Texto Itálico para os Deltas:</guilabel
></term
><listitem
><para
>Se seleccionar isto, então as diferenças no texto serão escritas com a versão itálica do tipo de letra seleccionado. Se o tipo de letra não suportar caracteres itálicos, isto não fará nada.</para>
   </listitem
></varlistentry>
</variablelist>
</sect2>

<sect2
><title
>Colors</title>
<variablelist>
   <varlistentry
><term
><guilabel
>Cor principal:</guilabel
></term
><listitem
><para
>Normalmente preto. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor de fundo:</guilabel
></term
><listitem
><para
>Normalmente branco. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor de Fundo das Diferenças:</guilabel
></term
><listitem
><para
>Normalmente a cinzento claro. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor A:</guilabel
></term
><listitem
><para
>Normalmente a azul escuro. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor B:</guilabel
></term
><listitem
><para
>Normalmente a verde escuro. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor C:</guilabel
></term
><listitem
><para
>Normalmente a magenta escuro. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor do Conflito:</guilabel
></term
><listitem
><para
>Normalmente a vermelho.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor de fundo do intervalo actual:</guilabel
></term
><listitem
><para
>Normalmente a amarelo claro.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Cor de fundo da diferença do intervalo actual:</guilabel
></term
><listitem
><para
>Normalmente a amarelo escuro.</para
></listitem
></varlistentry>
</variablelist>
<para
>On systems with only 16 or 256 colors some colors are not available in pure form. On such systems the <guibutton
>Defaults</guibutton
> button will choose a pure color. </para>
</sect2>

<sect2
><title
>Configuração do Editor</title>
<variablelist>
   <varlistentry
><term
><guilabel
>O Tab insere espaços:</guilabel
></term
><listitem
><para
>Se isto estiver desactivado e você carregar na tecla do tabulador, será inserido um carácter de tabulação, caso contrário serão inseridos os espaços com a quantidade apropriada.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Tamanho das tabulações:</guilabel
></term
><listitem
><para
>Poderá ser ajustado de acordo com as suas necessidades específicas. Por omissão é igual a 8. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Indentação automática:</guilabel
></term
><listitem
><para
>When pressing &Enter; or <keycap
>Return</keycap
> the indentation of the previous line is used for the new line. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Copiar automaticamente a selecção:</guilabel
></term
><listitem
><para
>Quando activo, qualquer selecção é posta automaticamente na área de transferência e não precisa de a copiar explicitamente. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Estilo de fim de linha:</guilabel
></term
><listitem
><para
>Ao gravar, o utilizador poderá seleccionar o estilo do fim de linha que prefere.O valor por omissão é a escolha comum para o sistema operativo usado. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Use locale encoding:</guilabel
></term
><listitem
><para
>For displaying foreign characters. Try changing this if some characters of your language aren't displayed correctly. </para
></listitem
></varlistentry>
</variablelist>
</sect2>

<sect2
><title
>Diff &amp; Merge Settings</title>
<para
>Ao comparar os ficheiros, o &kdiff3; tenta primeiro corresponder as linhas iguais em todos os ficheiros de entrada. Só durante este passo é que poderá ignorar os espaços em branco. O segundo passo compara cada uma das linhas. Neste passo, os espaços em branco não serão ignorados. Também durante a junção os espaços em branco não serão ignorados. </para>

<variablelist>
   <varlistentry
><term
><guilabel
>Manter o 'Carriage Return':</guilabel
></term
><listitem
><para
>Some editors (on some systems) save carriage return <literal
>\r</literal
> and linefeed <literal
>\n</literal
> characters at the end of line, while others will only save the linefeed <literal
>\n</literal
>. Usually &kdiff3; ignores the carriage return, but then files that don't have equal sizes, look equal in side by side comparison. When this option is on, then the carriage return characters are made visible but are treated as white space. This option must be off during a merge. Default is off.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Ignorar os números:</guilabel
></term
><listitem
><para
>Default is off. Number characters (<quote
><literal
>0-9</literal
></quote
>, <quote
><literal
>.</literal
></quote
>, <quote
><literal
>-</literal
></quote
>) will be ignored in the first part of the analysis in which the line matching is done. In the result the differences will be shown nevertheless, but they are treated as white space. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Ignorar comentários de C/C++:</guilabel
></term
><listitem
><para
>Por omissão está desligado. As alterações nos comentários serão tratadas como as alterações nos espaços em branco. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Ignorar a capitalização:</guilabel
></term
><listitem
><para
>Default is off. Case-differences of characters (like <quote
><literal
>A</literal
></quote
> vs. <quote
><literal
>a</literal
></quote
>) will be treated like changes in white space. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Comando do pré-processador:</guilabel
></term
><listitem
><para
>Veja a <link linkend="preprocessors"
>próxima secção</link
>. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Comando do Pré-processador para a Correspondência de Linhas:</guilabel
></term
><listitem
><para
>Veja a <link linkend="preprocessors"
>próxima secção</link
>. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Tentar com Persistência:</guilabel
></term
><listitem
><para
>Tenta com mais afinco encontrar um delta ainda menor. (Por omissão está ligado). Isto irá ser efectivo provavelmente para os ficheiros grandes e complicados. Será também lento para os ficheiros muito grandes. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Atraso no Avanço Automático (ms):</guilabel
></term
><listitem
><para
>Quando estiver no modo de avanço automático esta opção indica o intervalo de tempo durante o qual mostrar o resultado da selecção antes de saltar para o próximo conflito não resolvido. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Predefinição da junção de espaço em branco com 2/3 ficheiros:</guilabel
></term
><listitem
><para
>Automatically solve all white-space conflict by choosing the specified file. (Default is manual choice.) Useful if white-space really isn't important in many files. If you need this only occasionally better use <guimenuitem
>Choose A/B/C For All Unsolved Whitespace Conflicts</guimenuitem
> in the <guimenu
>Merge</guimenu
> menu. Note that if you enable either <guilabel
>Ignore numbers</guilabel
> or <guilabel
>Ignore C/C++ comments</guilabel
> then this auto-choice also applies for conflicts in numbers or comments. </para
></listitem
></varlistentry>
</variablelist>

</sect2>

<sect2
><title
>Junção de Pastas</title>
<para
>Estas opções dizem respeito à análise da pasta e ao tratamento da junção: Veja em <link linkend="dirmergeoptions"
>Comparação de Pastas/Juntar</link
> para mais detalhes. </para
><para
>Existe aqui ainda uma opção que também é relevante para gravar os ficheiros únicos: </para>
<variablelist>
   <varlistentry
><term
><guilabel
>Ficheiros de segurança:</guilabel
></term
><listitem
><para
>When a file is saved and an older version already exists, then the original version will be renamed with an <filename role="extension"
>.orig</filename
> extension. If an old backup file with <filename role="extension"
>.orig</filename
> extension already exists then this will be deleted without backup. </para
></listitem
></varlistentry>
</variablelist>
</sect2>

<sect2
><title
>Opções Regionais e da Língua</title>
  <variablelist>
    <varlistentry
><term
><guilabel
>Língua:</guilabel
></term
><listitem
><para
>Adjust the language of the user interface. Changing this option doesn't affect the running program. You have to exit and restart &kdiff3; so that the language is changed. (This option is not available in the &kde; version of &kdiff3; because the language is adjustable in the global &kde; settings.) </para
></listitem
></varlistentry>
    <varlistentry
><term
><guilabel
>Utilizar a mesma codificação para tudo:</guilabel
></term
><listitem
><para
>As seguintes opções de codificação poderão ser ajustadas em separado para cada item ou, se esta opção for verdadeira, todos os valores irão usar o primeiro valor. </para
></listitem
></varlistentry>
    <varlistentry
><term
><guilabel
>Codificação Local:</guilabel
></term
><listitem
><para
>Por cima dos selectores de codificação, aparece uma nota que lhe indica a sua codificação local. (Esta não é ajustável, mas está aqui apenas para o informar, no caso de não saber qual é a sua codificação local e tiver de a seleccionar). </para
></listitem
></varlistentry>
    <varlistentry
><term
><guilabel
>Codificação do Ficheiro para o A/B/C:</guilabel
></term
><listitem
><para
>Ajuste a codificação do ficheiro para os ficheiros de entrada. Isto provoca algum efeito na forma como os caracteres especiais são interpretados. Dado que poderá ajustar cada codificação em separado, poderá até comparar e juntar ficheiros que foram gravados com codificações diferentes. </para
></listitem
></varlistentry>
    <varlistentry
><term
><guilabel
>Codificação do Ficheiro para Junção de Resultado e Gravação:</guilabel
></term
><listitem
><para
>Quando tiver editado um ficheiro, poderá então ajustar a codificação que será usada ao gravar para o disco. </para
></listitem
></varlistentry>
    <varlistentry
><term
><guilabel
>Codificação do Ficheiro dos Ficheiros de Pré-processador:</guilabel
></term
><listitem
><para
>Quando definir pré-processadores, este poderão não ser capazes de lidar com a sua codificação. (p.ex.: Os seus ficheiros estão em Unicode de 16 bits e o seu pré-processador só consegue lidar com ASCII de 8 bits). Com esta opção, poderá definir a codificação do resultado do pré-processador. </para
></listitem
></varlistentry>
    <varlistentry
><term
><guilabel
>Língua da Esquerda-para-a-Direita:</guilabel
></term
><listitem
><para
>Some languages are written right to left. When this option is enabled, &kdiff3; draws the text from right to left in the diff input windows and in the merge output window. Note that if you start &kdiff3; with the command line option <option
>--reverse</option
> then all layouting will be done right to left too. (This is a feature provided by &Qt;.) This handbook was written assuming that <quote
>Right To Left Language</quote
> or reverse layout are disabled. So some references to <quote
>left</quote
> or <quote
>right</quote
> must be replaced by their respective counterpart if you use these options. </para
></listitem
></varlistentry>

  </variablelist>
</sect2>

<sect2
><title
>Diversos</title>
<para
>These options and actions are available in menus or the buttonbar.</para>
<variablelist>
  <varlistentry
><term
><guilabel
>Mostrar os números de linha:</guilabel
></term
><listitem
><para
>O utilizador pode seleccionar se os números de linhas são mostrados para os ficheiros de entrada.</para
></listitem
></varlistentry>
  <varlistentry
><term
><guilabel
>Mostrar as diferenças de espaços e tabulações:</guilabel
></term
><listitem
><para
>Algumas das vezes os espaços e tabulações visíveis são incómodos. Poderá com isto desactivar esta funcionalidade.</para
></listitem
></varlistentry>
  <varlistentry
><term
><guilabel
>Mostrar os espaços em branco:</guilabel
></term
><listitem
><para
>Turn this off to suppress any highlighting of white-space-only changes in the text or overview-columns. (Note that this also applies to changes in numbers or comments if the options <guilabel
>Ignore numbers</guilabel
> or "Ignore C/C++ comments" are active.)</para
></listitem
></varlistentry>
  <varlistentry
><term
><guilabel
>Opções da vista geral:</guilabel
></term
><listitem
><para
>These choices are only available when you compare three files. In normal mode all differences are shown in one color-coded overview-column. But sometimes you are especially interested in the differences between only two of these three files. Selecting <guilabel
>A vs. B</guilabel
>, <guilabel
>A vs. C</guilabel
> or <guilabel
>B vs. C</guilabel
> overview will show a second overview column with the required information next to the normal overview. </para
></listitem
></varlistentry>
  <varlistentry
><term
><guilabel
>Quebrar linha nas janelas de diferenças:</guilabel
></term
><listitem
><para
>Reparte as linhas quando o seu tamanho exceder a largura de uma janela. </para
></listitem
></varlistentry>
  <varlistentry
><term
><guimenuitem
>Mostrar a Janela A/B/C:</guimenuitem
></term
><listitem
><para
>Sometimes you want to use the space on the screen better for long lines. Hide the windows that are not important. (In the <guimenu
>Windows</guimenu
> menu.)</para
></listitem
></varlistentry>
  <varlistentry
><term
><guimenuitem
>Comutar a Orientação da Repartição:</guimenuitem
></term
><listitem
><para
>Switch between diff windows shown next to each other (A left of B left of C) or above each other (A above B above C). This should also help for long lines. (In the <guimenu
>Windows</guimenu
> menu.) </para
></listitem
></varlistentry>
  <varlistentry
><term
><guilabel
>Iniciar uma junção rapidamente:</guilabel
></term
><listitem
><para
>Sometimes you are viewing the deltas and decide to merge. <inlinemediaobject
><imageobject
><imagedata fileref="merge_current.png" format="PNG"/></imageobject
></inlinemediaobject
> <guimenuitem
>Merge current file</guimenuitem
> in the <guimenu
>Directory</guimenu
> menu also works if you only compare two files. A single click starts the merge and uses the filename of the last input-file as the default output filename. (When this is used to restart a merge, then the output filename will be preserved.)</para
></listitem
></varlistentry>
</variablelist>
</sect2>

<sect2 id="shortcuts"
><title
>Configurar os Atalhos de Teclado</title>
<para
>Currently only the &kde; version supports user-configurable keyboard-shortcuts. (<menuchoice
><guimenu
>Settings</guimenu
><guimenuitem
>Configure Shortcuts...</guimenuitem
></menuchoice
>) </para>
</sect2>
</sect1>

<sect1 id="preprocessors"
><title
>Comandos do Pré-processador</title>
<para
>O &kdiff3; suporta duas opções do pré-processador. </para
><para>
<variablelist>
   <varlistentry
><term
><guilabel
>Comando do pré-processador:</guilabel
></term
><listitem
><para
>When any file is read, it will be piped through this external command. The output of this command will be visible instead of the original file. You can write your own preprocessor that fulfills your specific needs. Use this to cut away disturbing parts of the file, or to automatically correct the indentation &etc;. </para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Comando do Pré-processador para a Correspondência de Linhas:</guilabel
></term
><listitem
><para
>Quando for lido qualquer ficheiro, ele será encaminhado através deste comando externo. Se um comando de pré-processador (ver acima) for também indicado, então o resultado do pré-processador é a entrada para o pré-processador de correspondência de linhas. O resultado só será usado durante a fase de correspondência de linhas da análise. O utilizador poderá escrever o seu próprio pré-processador que corresponda às suas necessidades específicas. Cada linha de entrada terá de ter uma linha de resultado correspondente. </para
></listitem
></varlistentry>
</variablelist>
</para>
<para
>A ideia é permitir ao utilizador uma maior flexibilidade ao configurar o resultado das diferenças. Mas isto necessita de um programa externo e muitos dos utilizadores não querem escrever um. As boas notícias é que, muitas das vezes, o <command
>sed</command
> ou o <command
>perl</command
> encarregar-se-ão disso. </para>
<para
>Example: Simple testcase: Consider file <filename
>a.txt</filename
> (6 lines):</para>
<screen
>aa
ba
ca
da
eafa
</screen>

<para
>And file <filename
>b.txt</filename
> (3 lines):</para>

<screen
>cg
dg
eg</screen>

<para
>Without a preprocessor the following lines would be placed next to each other:</para>

<screen
>aa - cg
ba - dg
ca - eg
da
ea
fa</screen>

<para
>This is probably not wanted since the first letter contains the actually interesting information. To help the matching algorithm to ignore the second letter we can use a line matching preprocessor command, that replaces <literal
>g</literal
> with <literal
>a</literal
>:</para>

<screen
><command
>sed</command
> 's/g/a/'</screen>

<para
>With this command the result of the comparison would be:</para>

<screen
>aa
ba
ca - cg
da - dg
ea - eg
fa</screen>

<para
>Internally the matching algorithm sees the files after running the line matching preprocessor, but on the screen the file is unchanged. (The normal preprocessor would change the data also on the screen.)</para>

<sect2 id="sedbasics"
><title
>Bases do <command
>sed</command
></title>
<para
>This section only introduces some very basic features of <command
>sed</command
>. For more information see <ulink url="info:/sed"
>info:/sed</ulink
> or <ulink url="http://www.gnu.org/software/sed/manual/html_mono/sed.html"
> http://www.gnu.org/software/sed/manual/html_mono/sed.html</ulink
>. A precompiled version for &Windows; can be found at <ulink url="http://unxutils.sourceforge.net"
> http://unxutils.sourceforge.net</ulink
>. Note that the following examples assume that the <command
>sed</command
> command is in some directory in the <envar
>PATH</envar
> environment variable. If this is not the case, you have to specify the full absolute path for the command. Also note that the following examples use the single quotation mark (<literal
>'</literal
>) which won't work for &Windows;. On &Windows; you should use the double quotation marks (<literal
>"</literal
>) instead.</para>
<para
>In this context only the <command
>sed</command
> substitute command is used:</para>
<screen
><command
>sed</command
> 's/<replaceable
>REGEXP</replaceable
>/<replaceable
>REPLACEMENT</replaceable
>/<replaceable
>FLAGS</replaceable
>'</screen>
<para
>Before you use a new command within &kdiff3;, you should first test it in a console. Here the <command
>echo</command
>-command is useful. Example:</para>

<screen
><command
>echo</command
> abrakadabra | <command
>sed</command
> 's/a/o/'
<computeroutput
>obrakadabra</computeroutput
></screen>

<para
>This example shows a very simple sed-command that replaces the first occurance of <quote
>a</quote
> with <quote
>o</quote
>. If you want to replace all occurances then you need the <parameter
>g</parameter
> flag:</para>

<screen
><command
>echo</command
> abrakadabra | <command
>sed</command
> 's/a/o/g'
<computeroutput
>obrokodobro</computeroutput
></screen>

<para
>The <quote
><literal
>|</literal
></quote
> symbol is the pipe-command that transfers the output of the previous command to the input of the following command. If you want to test with a longer file then you can use <command
>cat</command
> on Unix-like systems or <command
>type</command
> on &Windows;-like systems. <command
>sed</command
> will do the substitution for each line.</para>

<screen
><command
>cat</command
> <replaceable
>filename</replaceable
> |<command
>sed</command
> <replaceable
>options</replaceable
></screen>


</sect2>
<sect2 id="sedforkdiff3"
><title
>Exemplos para a Utilização do <command
>sed</command
> no &kdiff3;</title>
<sect3
><title
>Ignorar Outros Tipos de Comentários</title>
<para
>Currently &kdiff3; understands only C/C++ comments. Using the Line-Matching-Preprocessor-Command you can also ignore other types of comments, by converting them into C/C++-comments.</para>

<informalexample>
<para
>To ignore comments starting with <literal
>#</literal
>, you would like to convert them to <literal
>//</literal
>. Note that you also must enable the <guilabel
>Ignore C/C++-Comments</guilabel
> option to get an effect. An appropriate Line-Matching-Preprocessor-Command would be:</para>

<screen
><command
>sed</command
> 's/#/\/\//'</screen>
</informalexample>

<para
>Since for <command
>sed</command
> the <literal
>/</literal
> character has a special meaning, it is necessary to place the <literal
>\</literal
> character before each <literal
>/</literal
> in the replacement string. Sometimes the <literal
>\</literal
> is required to add or remove a special meaning of certain characters. The single quotation marks (<literal
>'</literal
>) before and after the substitution-command are important now, because otherwise the shell will try to interpret some special characters like <literal
>#</literal
>, <literal
>$</literal
> or <literal
>\</literal
> before passing them to <command
>sed</command
>. Note that on &Windows; you will need the double quotation marks (<literal
>"</literal
>) here. &Windows; substitutes other characters like <literal
>%</literal
>, so you might have to experiment a little bit.</para>
</sect3>

<sect3
><title
>Diff sem Distinguir Capitalização</title>

<para
>Use the following Line-Matching-Preprocessor-Command to convert all input to uppercase:</para>

<screen
><command
>sed</command
> 's/\(.*\)/\U\1/'</screen>

<para
>Here the <quote
><literal
>.*</literal
></quote
> is a regular expression that matches any string and in this context matches all characters in the line. The <literal
>\1</literal
> in the replacement string refers to the matched text within the first pair of <literal
>\(</literal
> and <literal
>\)</literal
>. The <literal
>\U</literal
> converts the inserted text to uppercase. </para>
</sect3>

<sect3
><title
>Ignorar as Palavras-Chave do Controlo de Versões</title>
<para
><acronym
>CVS</acronym
> and other version control systems use several keywords to insert automatically generated strings (<ulink url="info:/cvs/Keyword substitution"
>info:/cvs/Keyword substitution</ulink
>). All of them follow the pattern <literal
>$KEYWORD generated text$</literal
>. We now need a Line-Matching-Preprocessor-Command that removes only the generated text:</para>
<screen
><command
>sed</command
> 's/\$\(Revision\|Author\|Log\|Header\|Date\).*\$/\$\1\$/'</screen>

<para
>The <literal
>\|</literal
> separates the possible keywords. You might want to modify this list according to your needs. The <literal
>\</literal
> before the <literal
>$</literal
> is necessary because otherwise the <literal
>$</literal
> matches the end of the line. </para>
<para
>Ao experimentar com o <command
>sed</command
>, você poderá vir a compreender e até a gostar destas expressões regulares. Elas são úteis porque existem muitos outros programas que suportam algumas coisas desse género. </para>
</sect3>

<sect3
><title
>Ignorar os Números</title>
<para
>Ignoring numbers actually is a built-in option. But as another example, this is how it would look as a Line-Matching-Preprocessor-command.</para>
<screen
><command
>sed</command
> 's/[0123456789.-]//g'</screen>
<para
>Any character within <literal
>[</literal
> and <literal
>]</literal
> is a match and will be replaced with nothing. </para>
</sect3>

<sect3
><title
>Ignorar Certas Colunas</title>
<para
>Sometimes a text is very strictly formatted, and contains columns that you always want to ignore, while there are other columns you want to preserve for analysis. In the following example the first five columns (characters) are ignored, the next ten columns are preserved, then again five columns are ignored and the rest of the line is preserved.</para>

<screen
><command
>sed</command
> 's/.....\(..........\).....\(.*\)/\1\2/'</screen>

<para
>Each dot <literal
>.</literal
> matches any single character. The <literal
>\1</literal
> and <literal
>\2</literal
> in the replacement string refer to the matched text within the first and second pair of <literal
>\(</literal
> and <literal
>\)</literal
> denoting the text to be preserved.</para>
</sect3>

<sect3
><title
>Combinar Várias Substituições</title>

<para
>Sometimes you want to apply several substitutions at once. You can then use the semicolon <literal
>;</literal
> to separate these from each other.</para>

<screen
><command
>echo</command
> abrakadabra | <command
>sed</command
> 's/a/o/g;s/\(.*\)/\U\1/'
<computeroutput
>OBROKODOBRO</computeroutput
></screen>

</sect3>

<sect3
><title
>Usar o <command
>perl</command
> em vez do <command
>sed</command
></title>
<para
>Instead of <command
>sed</command
> you might want to use something else like <command
>perl</command
>.</para>
<screen
><command
>perl</command
> -p -e 's/<replaceable
>REGEXP</replaceable
>/<replaceable
>REPLACEMENT</replaceable
>/<replaceable
>FLAGS</replaceable
>'</screen>
<para
>But some details are different in <command
>perl</command
>. Note that where <command
>sed</command
> needed <literal
>\(</literal
> and <literal
>\)</literal
> <command
>perl</command
> requires the simpler <literal
>(</literal
> and <literal
>)</literal
> without preceding <literal
>\</literal
>.</para>

<screen
><command
>sed</command
> 's/\(.*\)/\U\1/'
<command
>perl</command
> -p -e 's/(.*)/\U\1/'</screen>

</sect3>
</sect2>

<sect2
><title
>Order de Execução de Pré-processadores</title>
<para
>Os dados são encaminhados através de todos os pré-processadores internos e externos pela seguinte ordem: </para>
<itemizedlist>
<listitem
><para
>Pré-processador normal,</para
></listitem>
<listitem
><para
>Pré-processador de Correspondência de Linhas,</para
></listitem>
<listitem
><para
>Ignorar capitalização (conversão para maiúsculas),</para
></listitem>
<listitem
><para
>Detecção de Comentários de C/C++,</para
></listitem>
<listitem
><para
>Ignorar os números,</para
></listitem>
<listitem
><para
>Ignorar os espaços em branco</para
></listitem>
</itemizedlist>
<para
>Os dados após o pré-processador normal serão preservados para a apresentação e para a junção. As outras operações só modificam os dados que o algoritmo para a correspondência de linhas nas diferenças vê. </para
><para
>Nos casos raros em que você usa um pré-processador normal, repare que o pré-processador da correspondência de linhas vê o resultado no pré-processador normal como dados de entrada. </para>
</sect2>

<sect2
><title
>Aviso</title>
<para
>Os comandos do pré-processador são normalmente muito úteis, mas como acontece com qualquer opção que modifica os seus textos ou esconde algumas diferenças automaticamente, você poderá saltar por cima de certas diferenças e, no pior dos casos, destruir dados importantes. </para
><para
>For this reason during a merge if a normal preprocessor-command is being used &kdiff3; will tell you so and ask you if it should be disabled or not. But it won't warn you if a Line-Matching-Preprocessor-command is active. The merge will not complete until all conflicts are solved. If you disabled <guilabel
>Show White Space</guilabel
> then the differences that were removed with the Line-Matching-Preprocessor-command will also be invisible. If the Save-button remains disabled during a merge (because of remaining conflicts), make sure to enable <guilabel
>Show White Space</guilabel
>. If you don't wan't to merge these less important differences manually you can select <guimenuitem
>Choose [A|B|C] For All Unsolved Whitespace Conflicts</guimenuitem
> in the <guimenu
>Merge</guimenu
> menu. </para>
</sect2>
</sect1>
</chapter>


<chapter id="dirmerge"
><title
>Comparação e Junção de Directorias com o &kdiff3;</title>
<sect1 id="dirmergeintro"
><title
>Introdução</title>
<para
>Normalmente, os programadores precisam de modificar vários ficheiros numa pasta para atingir os seus fins. Para isso, o &kdiff3; também lhe permite comparar e juntar várias pastas de forma recursiva! </para
><para
>Even though comparing and merging directories seems to be quite obvious, there are several details that you should know about. Most important is of course the fact that now many files might be affected by each operation. If you don't have backups of your original data, then it can be very hard or even impossible to return to the original state. So before starting a merge, make sure that your data is safe, and going back is possible. If you make an archive or use some version control system is your decision, but even experienced programmers and integrators need the old sources now and then. And note that even though I (the author of &kdiff3;) try to do my best, I can't guarantee that there are no bugs. According to the GNU GPL there is NO WARRANTY whatsoever for this program. So be humble and always keep in mind: </para>
<blockquote
><para>
   <emphasis
>Errar é humano, mas para realmente baralhar as coisas é preciso um computador.</emphasis>
</para
></blockquote>
<para
>Por isso, este é o programa que poderá fazer isto por si: o &kdiff3; ... </para>
<itemizedlist>
     <listitem
><para
>... lê e compara duas ou três pastas recursivamente,</para
></listitem>
     <listitem
><para
>... tem um cuidado especial com as ligações simbólicas,</para
></listitem>
     <listitem
><para
>... permite-lhe navegar nos ficheiros com um duplo-click do rato,</para
></listitem>
     <listitem
><para
>... propõe para cada item uma operação de junção, a qual poderá alterar antes de iniciar a junção de pastas,</para
></listitem>
     <listitem
><para
>... permite-lhe simular a junção e lista as acções que iriam tomar lugar, sem fazer nada de facto,</para
></listitem>
     <listitem
><para
>... permite-lhe fazer realmente a junção, possibilitando também a você interagir nas situações em que é necessária uma interacção manual,</para
></listitem>
     <listitem
><para
>... lets you run the selected operation for all items (key <keycap
>F7</keycap
>) or the selected item (key <keycap
>F6</keycap
>),</para
></listitem>
     <listitem
><para
>... lets you continue the merge after manual interaction with key <keycap
>F7</keycap
>,</para
></listitem>
     <listitem
><para
>... optionally creates backups, with the <filename role="extension"
>.orig</filename
> extension,</para
></listitem>
     <listitem
><para
>...</para
></listitem>
</itemizedlist>
</sect1>

<sect1 id="startingdirmerge"
><title
>Iniciar a Comparação ou Junção de Directoria</title>
<para
>Isto é bastante semelhante à junção e comparação simples com ficheiros únicos. O utilizador apenas terá de indicar nomes de pastas na linha de comandos ou na janela de abertura de ficheiros. </para>
<sect2
><title
>Comparar/Juntar duas directorias: </title>
<screen
><command
>kdiff3</command
> <replaceable
>dir1 dir2</replaceable>
   <command
>kdiff3</command
> <replaceable
>dir1 dir2</replaceable
> <option
>-o</option
> <replaceable
>destdir</replaceable
>
</screen>
<para
>Se não for indicada nenhuma pasta de destino, então o &kdiff3; irá usar a <replaceable
>pasta2</replaceable
>. </para>
</sect2>

<sect2
><title
>Comparar/Juntar estas pastas: </title>
<screen
><command
>kdiff3</command
> <replaceable
>dir1 dir2 dir3</replaceable>
   <command
>kdiff3</command
> <replaceable
>dir1 dir2 dir3</replaceable
> <option
>-o</option
> <replaceable
>destdir</replaceable
>
</screen>
<para
>Quando forem reunidas três pastas, então a <replaceable
>pasta1</replaceable
> será usada como a base para a junção. Se não for indicada nenhuma pasta de destino, então o &kdiff3; irá usar a <replaceable
>pasta3</replaceable
> como pasta de destino para a junção. </para>

<para
>Note that only the comparison starts automatically, not the merge. For this you first must select a menu entry or the key <keycap
>F7</keycap
>. (More details later.) </para>
</sect2>
</sect1>

<sect1 id="dirmergevisible"
><title
>Visible Information</title>
<para
>Ao ler as pastas, aparece uma mensagem que o informa do progresso. Se você interromper a pesquisa das pastas, então só os ficheiros que tenham sido comparados até então serão listados. </para
><para
>Quando a pesquisa de pastas estiver completa, então o &kdiff3; irá mostrar uma lista com os resultados restantes, ... </para>
<screenshot
><mediaobject>
<imageobject
><imagedata fileref="dirbrowser.png" format="PNG"/></imageobject
> <!--alt="Image of the directory browser."-->
</mediaobject
></screenshot>
<para
>... e os detalhes sobre o item seleccionado de momento à direita: </para>
<screenshot
><mediaobject>
<imageobject
><imagedata fileref="iteminfo.png" format="PNG"/></imageobject>
   <!--alt="Image with information about the selected item."-->
</mediaobject
></screenshot>

<sect2 id="name"
><title
>A Coluna do Nome</title>
<para
>Cada ficheiro e pasta encontrado durante a pesquisa é aqui mostrado numa árvore. Você poderá seleccionar um item se carregar nele uma vez com o rato. </para
><para
>The directories are collapsed by default. You can expand and collapse them by clicking on the <guiicon
>+</guiicon
>/<guiicon
>-</guiicon
> or by double-clicking the item or by using the <keycap
>Left Arrow</keycap
> or <keycap
>Right Arrow</keycap
> keys. The <guimenu
>Directory</guimenu
> menu also contains two actions <guimenuitem
>Fold all subdirs</guimenuitem
> and <guimenuitem
>Unfold all subdirs</guimenuitem
> with which you can collapse or expand all directories at once. </para
><para
>Se fizer duplo-click num item de um ficheiro, então a comparação do ficheiro irá começar e irá aparecer a janela de diferenças do ficheiro. </para>
<para
>The image in the name column reflects the file type in the first directory (<quote
>A</quote
>). It can be one of these: </para>
<itemizedlist>
     <listitem
><para
>Ficheiro normal</para
></listitem>
     <listitem
><para
>Pasta normal (imagem de pasta)</para
></listitem>
     <listitem
><para
>Ligação para um ficheiro (imagem de ficheiro com uma seta de ligação)</para
></listitem>
     <listitem
><para
>Ligação para uma pasta (imagem de pasta com uma seta de ligação)</para
></listitem>
</itemizedlist>
<para
>Se o tipo de ficheiro for diferente nas outras pastas, então isso é visível nas colunas A/B/C e na janela que mostra os detalhes sobre o item seleccionado. Repare que, neste caso, não poderá ser seleccionada nenhuma operação de junção automaticamente. Ao iniciar a junção, então o utilizador será informado dos problemas desse tipo. </para>
</sect2>

<sect2 id="coloring"
><title
>As Colunas A/B/C e o Esquema de Cores</title>
<para
>Como pode ser visto na imagem acima, as cores vermelha, verde, amarela e preta são usadas nas colunas A/B/C. </para>
<itemizedlist>
     <listitem
><para
>Preto: O item não existe nesta pasta.</para
></listitem>
     <listitem
><para
>Verde: Item mais recente.</para
></listitem>
     <listitem
><para
>Amarelo: Mais antigo que o verde, mais recente que o vermelho.</para
></listitem>
     <listitem
><para
>Vermelho: O item mais antigo.</para
></listitem>
</itemizedlist>
<para
>Contudo, para os itens que eram idênticos na comparação, a sua cor é também idêntica mesmo que a idade seja diferente. </para
><para
>As pastas são consideradas iguais se todos os itens que contêm forem idênticos. Nesse caso, elas terão a mesma cor. Porém, a idade de uma pasta não é tida em consideração de acordo com a sua cor. </para
><para
>A ideia do autor para este esquema de coloração veio do <ulink url="http://samba.org/cgi-bin/cvsweb/dirdiff"
>dirdiff</ulink
>. As cores lembram as cores de uma folha que é verde quando é nova, vai-se tornando amarela com o tempo e é vermelha quando é antiga. </para>

</sect2
><sect2 id="operation"
><title
>A Coluna de Operação</title>
<para
>After comparing the directories &kdiff3; also evaluates a proposal for a merge operation. This is shown in the <guilabel
>Operation</guilabel
> column. You can modify the operation by clicking on the operation you want to change. A small menu will popup and allows you to select an operation for that item. (You can also select the most needed operations via keyboard. Ctrl+1/2/3/4/Del will select A/B/C/Merge/Delete respectively if available.) This operation will be executed during the merge. It depends on the item and on the merge-mode you are in, what operations are available. The merge-mode is one of </para>
<itemizedlist>
     <listitem
><para
>Three directory-merge (<quote
>A</quote
> is treated as older base of both).</para
></listitem>
     <listitem
><para
>Junção de duas pastas.</para
></listitem>
     <listitem
><para
>Two directory-sync-mode (activate via option <guimenuitem
>Synchronize Directories</guimenuitem
>).</para
></listitem>
</itemizedlist>
<para
>Na junção de três pastas, a proposta de operação será: Se para um item ... </para>
<itemizedlist>
     <listitem
><para
>all three directories are equal: Copy from C</para
></listitem>
     <listitem
><para
>A and C are equal but B is not: Copy from B (or if B does not exist, delete the destination if exists)</para
></listitem>
     <listitem
><para
>A and B are equal but C is not: Copy from C (or if C does not exist, delete the destination if exists)</para
></listitem>
     <listitem
><para
>B and C are equal but A is not: Copy from C (or if C does not exist, delete the destination if exists)</para
></listitem>
     <listitem
><para
>only A exists: Delete the destination (if exists)</para
></listitem>
     <listitem
><para
>only B exists: Copy from B</para
></listitem>
     <listitem
><para
>only C exists: Copy from C</para
></listitem>
     <listitem
><para
>A, B and C are not equal: Merge</para
></listitem>
     <listitem
><para
>A, B and C don't have the same file type (&eg; A is a directory, B is a file): <errorname
>Error: Conflicting File Types</errorname
>. While such items exist the directory merge cannot start.</para
></listitem>
</itemizedlist>
<para
>Na junção de duas pastas, a proposta de operação será: Se para um item ... </para>
<itemizedlist>
     <listitem
><para
>both directories are equal: Copy from B</para
></listitem>
     <listitem
><para
>A exists, but not B: Copy from A</para
></listitem>
     <listitem
><para
>B exists, but not A: Copy from B</para
></listitem>
     <listitem
><para
>A and B exist but are not equal: Merge</para
></listitem>
     <listitem
><para
>A and B don't have the same file type (&eg; A is a directory, B is a file): <errorname
>Error: Conflicting File Types</errorname
>. While such items exist the directory merge cannot start.</para
></listitem>
</itemizedlist>
<para
>Sync-mode is active if only two directories and no explicit destination were specified and if the option <guilabel
>Synchronize directories</guilabel
> is active. &kdiff3; then selects a default operation so that both directories are the same afterwards. If for an item </para>
<itemizedlist>
     <listitem
><para
>both directories are equal: Nothing will be done.</para
></listitem>
     <listitem
><para
>A exists, but not B: Copy A to B</para
></listitem>
     <listitem
><para
>B exists, but not A: Copy B to A</para
></listitem>
     <listitem
><para
>A and B exist, but are not equal: Merge and store the result in both directories. (For the user the visible save-filename is B, but then &kdiff3; copies B also to A.)</para
></listitem>
     <listitem
><para
>A and B don't have the same file type (&eg; A is a directory, B is a file): <errorname
>Error: Conflicting File Types</errorname
>. While such items exist the directory merge cannot start.</para
></listitem>
</itemizedlist>
<para
>When two directories are merged and the option <guilabel
>Copy newer instead of merging</guilabel
> is selected, then &kdiff3; looks at the dates and proposes to choose the newer file. If the files are not equal but have equal dates, then the operation will contain <errorname
>Error: Dates are equal but files are not.</errorname
> While such items exist the directory merge cannot start. </para>
</sect2>

<sect2 id="status"
><title
>A Coluna de Estado</title>
<para
>During the merge one file after the other will be processed. The status column will show <computeroutput
>Done</computeroutput
> for items where the merge operation has succeeded, and other texts if something unexpected happened. When a merge is complete, then you should make a last check to see if the status for all items is agreeable. </para>
</sect2>

<sect2 id="statisticscolulmns"
><title
>Colunas de Estatísticas</title>
<para
>When the file comparison mode <guilabel
>Full Analysis</guilabel
> is enabled in the options, then &kdiff3; will show extra columns containing the numbers of unsolved, solved, nonwhite and whitespace conflicts. (The solved-column will only show when comparing or merging three directories.) </para>
</sect2>

</sect1>


<sect1 id="dothemerge"
><title
>Doing A Merge</title>
<para
>O utilizador tanto poderá reunir o item seleccionado de momento (ficheiro ou pasta) ou todos os itens. Quando tiver feito todas as suas opções de operação (em todas as subpastas também), aí então poderá iniciar a junção. </para
><para
>Be aware that if you didn't specify a destination directory explicitely, then the destination will be <quote
>C</quote
> in three directory mode, <quote
>B</quote
> in two directory merge mode, and in sync-mode it will be <quote
>A</quote
> and/or <quote
>B</quote
>. </para
><para
>Se tiver indicado uma pasta de destino, verifique também que todos os itens que deverão estar no resultado, estão na árvore respectiva. Existem algumas opções que fazem com que certos itens sejam omitidos na comparação e junção de pastas. Assinale estas opções para evitar surpresas desagradáveis: </para>
<itemizedlist>
     <listitem
><para
><guilabel
>Recursive Directories</guilabel
>: If this is off, then items in subdirectories will not be found.</para
></listitem>
     <listitem
><para
><guilabel
>Pattern</guilabel
>/<guilabel
>Anti-Pattern</guilabel
>: Include/exclude items that match</para
></listitem>
     <listitem
><para
><guilabel
>Exclude Hidden Files</guilabel
></para
></listitem>
     <listitem
><para
><guilabel
>List only Deltas</guilabel
>: Files that match in all directories don't appear in the tree, and hence also not in the destination.</para
></listitem>
</itemizedlist>
<para
>(In the current version, you must do a rescan via menu <menuchoice
><guimenu
>Directory</guimenu
><guimenuitem
>Rescan</guimenuitem
></menuchoice
> yourself, after changing options affecting the directory scan.) </para
><para
>Se estiver satisfeito até agora, o resto é simples. </para
><para
>To merge all items: Select <guimenuitem
>Start/Continue directory merge</guimenuitem
> in the <guimenu
>Directory</guimenu
> menu or press <keycap
>F7</keycap
> (which is the shortcut). To merge only the current item: Select <guimenuitem
>Run Operation For Current Item</guimenuitem
> or press <keycap
>F6</keycap
>. </para
><para
>Se, devido à existência de tipos de ficheiro em conflito, ainda permanecerem alguns itens com operações inválidas, então irá aparecer uma mensagem onde serão evidenciados esses itens, para que possa seleccionar uma operação válida para cada item. </para
><para
>If you merge all items a dialog will appear giving you the options <guibutton
>Do it</guibutton
>, <guibutton
>Simulate it</guibutton
> and <guibutton
>Cancel</guibutton
>. </para>
<itemizedlist>
     <listitem
><para
>Select <guibutton
>Simulate it</guibutton
> if you want to see what would be done without actually doing it. A verbose list of all operations will be shown.</para
></listitem>
     <listitem
><para
>Otherwise select <guibutton
>Do it</guibutton
> to really start merging.</para
></listitem>
</itemizedlist>
<para
>Nesse caso, o &kdiff3; irá executar a operação indicada para todos os itens. Se for necessária alguma intervenção manual (na junção de ficheiros simples), então irá aparecer uma janela de junção (<link linkend="dirmergebigscreenshot"
>ver a imagem grande</link
>). </para
><para
>When you have finished with a file, again select <guimenuitem
>Start/Continue directory merge</guimenuitem
> or the key <keycap
>F7</keycap
>. If you haven't saved yet, a dialog will ask you to do so. Then &kdiff3; will continue with the next item. </para
><para
>When &kdiff3; encounters an error, it will tell you so and will show the verbose-status-information. At the bottom of this list, there will be some error messages which should help you to understand the cause of the problem. When you continue merging (<keycap
>F7</keycap
> key) &kdiff3; will give you the choice to retry or skip the item that caused the problem. This means that before continuing you can choose another operation or solve the problem by other means. </para
><para
>Quando a junção estiver completa, o &kdiff3; informá-lo-á então com uma mensagem. </para
><para
>If some items were merged individually then &kdiff3; remembers this (while this merge-session goes on), and doesn't merge them again when later the merge for all items is run. Even when the merge was skipped or nothing was saved these items count as completed. Only when you change the merge operation the item will be merged again. </para>
</sect1>

<sect1 id="dirmergeoptions"
><title
>Opções para Comparar e Juntar Pastas</title>
<para
>The &kdiff3; preferences (menu <menuchoice
><guimenu
>Settings</guimenu
><guimenuitem
>Configure KDiff3</guimenuitem
></menuchoice
>) now has a section called <guilabel
>Directory Merge</guilabel
> with these options: </para>

<variablelist>
   <varlistentry
><term
><guilabel
>Directorias Recursivas:</guilabel
></term
><listitem
><para
>Indica se você deseja pesquisar as pastas de forma recursiva.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Padrões de Ficheiros:</guilabel
></term
><listitem
><para
>Only files that match any pattern here will be put in the tree. More than one pattern may be specified here via using the semicolon <literal
>;</literal
> as separator. Valid wildcards: <literal
>*</literal
> and <literal
>?</literal
>. (&eg; <literal
>*.cpp;*.h</literal
>). Default is <literal
>*</literal
>. Directories need not match this pattern.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Anti-Pattern(s):</guilabel
></term
><listitem
><para
>Files and directories that match this pattern will be excluded from the tree. More than one pattern may be specified here via using the semicolon <literal
>;</literal
> as separator. Valid wildcards: <literal
>*</literal
> and <literal
>?</literal
>. Default is <literal
>*.orig;*.o</literal
>.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Usar CVS-Ignore:</guilabel
></term
><listitem
><para
>Ignore files and directories that would also be ignored by <acronym
>CVS</acronym
>. Many automatically generated files are ignored by <acronym
>CVS</acronym
>. The big advantage is that this can be directory specific via a local <filename
>.cvsignore</filename
> file. (See <ulink url="info:/cvs/cvsignore"
>info:/cvs/cvsignore</ulink
>.)</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Procurar os Ficheiros e Directorias Escondidos:</guilabel
></term
><listitem
><para
>On some filesystems files have an <quote
>Hidden</quote
> attribute. On other systems a filename starting with a dot (<literal
>.</literal
>) causes it to be hidden. This option allows you to decide whether to include these files in the tree or not. Default is on.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Seguir as Ligações de Ficheiros:</guilabel
></term
><listitem
><para
>Para as ligações aos ficheiros: Quando a opção estiver desactivada, as ligações simbólicas serão comparadas. Caso contrário, serão compilados os ficheiros para os quais apontam as ligações. Por omissão, a opção está desligada.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Seguir as Ligações de Directorias:</guilabel
></term
><listitem
><para
>For links to directories: When disabled, then the symbolic links will be compared. When enabled then the link will be treated like a directory and it will be scanned recursively. (Note that the program doesn't check if the link is <quote
>recursive</quote
>. So for example a directory that contains a link to the directory would cause an infinite loop, and after some time when the stack overflows or all memory is used up, crash the program.) Default is off.</para
></listitem
></varlistentry
>   
   <varlistentry
><term
><guilabel
>List only deltas:</guilabel
></term
><listitem
><para
>Only items that are not equal in all input directories will be listed and only the changed files are visible. Hence files that are equal in all directories won't be copied during a merge and if the destination dir does not contain the files before the merge, you might miss some files later. (This option is likely to be changed in a later version.) Default is off.</para
></listitem
></varlistentry>

   <varlistentry
><term
><guilabel
>Modo de Comparação de Ficheiros:</guilabel
></term
><listitem
><para>
<variablelist
>            
   <varlistentry
><term
><guilabel
>Comparação Binária:</guilabel
></term
><listitem
><para
>Este é o modo de comparação de ficheiros por omissão. </para
></listitem
></varlistentry
>         
   <varlistentry
><term
><guilabel
>Análise Completa:</guilabel
></term
><listitem
><para
>Faz uma análise completa de cada ficheiro e mostra os resultados nas colunas de informação das estatísticas. (O número de conflitos resolvidos, por resolver, devido a espaços em branco ou a outros casos). A análise completa é mais lenta que uma simples comparação binária e é muito mais lenta se for usada em ficheiros que não contenham texto. (Indique os tipos de anti-padrões necessários.) </para
></listitem
></varlistentry
>         
   <varlistentry
><term
><guilabel
>Confiar na data de modificação:</guilabel
></term
><listitem
><para
>Se comparar pastas grandes numa rede lenta, poderá ser mais rápido comparar somente as datas de modificação e os tamanhos dos ficheiros. Porém, este melhoramento de velocidade traz alguma incerteza. Use esta opção com cuidado. Por omissão, está desligada.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Confiar no tamanho:</guilabel
></term
><listitem
><para
>É semelhante à comparação da data de modificação. Não ocorre nenhuma comparação em si. Dois ficheiros quaisquer são considerados iguais se os seus tamanhos de ficheiros forem iguais. Isto é útil quando a operação de cópia de ficheiros não preservar a data de modificação. Use esta opção com cuidado. Por omissão, está desligada.</para
></listitem
></varlistentry>
</variablelist
></para
></listitem
></varlistentry>
         
   <varlistentry
><term
><guilabel
>Sincronizar as Directorias:</guilabel
></term
><listitem
><para
>Activa o "Modo de Sincronização" em que duas pastas são comparadas e não foi indicada nenhuma pasta de destino. Neste modo, as operações propostas serão escolhidas de modo a que ambas as pastas de origem fiquem iguais no fim. Do mesmo modo, o resultado da junção será gravado em ambas as pastas. Por omissão, esta opção está desligada.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Copiar o mais recente em vez de juntar:</guilabel
></term
><listitem
><para
>Instead of merging the proposed operation will copy the newer source if changes happened. (Considered unsafe, because it implies that the knowledge, that the other file hasn't been edited too. Check to make sure in every case.) Default is off.</para
></listitem
></varlistentry>
   <varlistentry
><term
><guilabel
>Ficheiros de segurança:</guilabel
></term
><listitem
><para
>If a file or complete directory is replaced by another or is deleted then the original version will be renamed with an <literal role="extension"
>.orig</literal
> extension. If an old backup file with <literal role="extension"
>.orig</literal
> extension already exists then this will be deleted without backup. This also affects the normal merging of single files, not only in directory-merge mode. Default is on.</para
></listitem
></varlistentry>
</variablelist>
</sect1>

<sect1 id="other"
><title
>Other Functions</title>
<sect2
><title
>Modo de Ecrã Repartido/Completo</title>
<para
>Usually the directory merge list view remains visible while a single file is compared or merged. With the mouse you can move the the splitter bar that separates the file list from the text-diff windows. If you don't want this, you can disable <guimenuitem
>Split Screen View</guimenuitem
> in the <guimenu
>Directory</guimenu
> menu. Then you can use <guimenuitem
>Toggle View</guimenuitem
> in the <guimenu
>Directory</guimenu
> menu to switch between the file list and the text-diff view that then occupy the full screen. </para>
</sect2>
<sect2
><title
>Comparar ou Juntar um Único Ficheiro</title>
<para
>Probably you will prefer a simple double mouse click on a file in order to compare it. Nevertheless there also exists an entry in the <guimenu
>Directory</guimenu
> menu. You can also directly merge a single file, without starting the directory merge via the <guimenuitem
>Merge single file</guimenuitem
> in the <guimenu
>Directory</guimenu
> Menu. On saving the result, the status will be set to done, and the file will not be merged again if a directory merge is started. </para
><para
>But note that this status information will be lost when you rerun a directory scan: <menuchoice
><guimenu
>Directory</guimenu
><guimenuitem
>Rescan</guimenuitem
></menuchoice
> </para>
</sect2>
</sect1>
</chapter>

<chapter id="misc">
<title
>Tópicos Diversos</title>
<sect1 id="networktransparency">
<title
>Network Transparency via KIO</title>
<sect2
><title
>KIO-Slaves</title>
<para
>&kde; supports networktransparency via KIO-slaves. &kdiff3; uses this for reading input files and for scanning directories. This means that you can specify files and directories on local and remote resources via &URL;s. </para
><para
>Exemplo: </para
><para>
<screen
><command
>kdiff3</command
> teste.cpp  ftp://ftp.longe.org/teste.cpp
   <command
>kdiff3</command
> tar:/home/eu/pacote.tar.gz/pasta ./pasta
</screen>
</para>
<para
>The first line compares a local file with a file on an &FTP; server. The second line compares a directory within an compressed archive with a local directory. </para
><para
>Outros 'KIO-slaves' que serão interessantes: </para>
<itemizedlist>
<listitem
><para
>Ficheiros da WWW (http:),</para
></listitem>
<listitem
><para
>Ficheiros de FTP (ftp:),</para
></listitem>
<listitem
><para
>Transferência de ficheiros cifrada (fish:, sftp:),</para
></listitem>
<listitem
><para
>Windows-resources (smb:),</para
></listitem>
<listitem
><para
>Ficheiros locais (file:),</para
></listitem>
</itemizedlist>
<para
>Outras coisas que são possíveis, mas provavelmente serão menos interessantes: </para>
<itemizedlist>
<listitem
><para
>Páginas do 'man' (man:),</para
></listitem>
<listitem
><para
>Páginas do 'info' (info:),</para
></listitem>
</itemizedlist>
</sect2>

<sect2
><title
>How To Write &URL;s</title>
<para
>A &URL; has a different syntax compared with paths for local files and directories. Some things should be considered: </para>
<itemizedlist>
<listitem
><para
>A path can be relative and can contain <literal
>.</literal
> or <literal
>..</literal
>. This is not possible for &URL;s which are always absolute. </para
></listitem
><listitem
><para
>Special characters must be written with <quote
>escaping</quote
>. (<quote
>#</quote
> becomes <quote
>%23</quote
>, spaces become <quote
>%20</quote
> and so on.) &eg; A file with the name <quote
>/#foo#</quote
> would have the &URL; <literal
>file:///%23foo%23</literal
>. </para
></listitem
><listitem
><para
>When &URL;s don't work as expected, try to open them in &konqueror; first. </para
></listitem>
</itemizedlist>

</sect2>

<sect2
><title
>Capacidades dos 'KIO-Slaves'</title>
<para
>Network transparency has one drawback: Not all ressources have the same capabilities. </para
><para
>Sometimes this is due to the filesystem of the server, sometimes due to the protocol. Here is a short list of restrictions: </para>
<itemizedlist>
<listitem
><para
>Em alguns casos não existe o suporte para ligações simbólicas. </para
></listitem
><listitem
><para
>Ou não existe forma de distinguir se uma ligação aponta para um ficheiro ou uma pasta; é assumido sempre um ficheiro. (ftp:, sftp:). </para
></listitem
><listitem
><para
>Não é sempre possível determinar o tamanho do ficheiro. </para
></listitem
><listitem
><para
>Existe um suporte de permissões limitado. </para
></listitem
><listitem
><para
>Não existe a possibilidade de modificar as permissões ou a data de modificação, como tal as permissões ou a data de uma cópia poderão ser diferentes do original. (Veja a opção "Confiar no tamanho".) (A modificação de permissões ou das datas só é possível para os ficheiros locais.) </para
></listitem>
</itemizedlist>
</sect2>
</sect1>

<sect1 id="kpart">
<title
>Usar o &kdiff3; como uma KPart</title>
<para
>&kdiff3; is a KPart. Currently it implements the <interface
>KParts::ReadOnlyPart</interface
> interface. </para
><para
>It's main use is as difference-viewer in <application
>KDevelop</application
>. <application
>Kdevelop</application
> always starts the internal difference viewer first. To invoke &kdiff3; press the &RMB; on the difference viewer window and select <guimenuitem
>Show in KDiff3Part</guimenuitem
> from the contextmenu. </para
><para
>O &kdiff3; necessita normalmente de dois ficheiros completos como entrada. Se for usado como componente KPart, o &kdiff3; irá assumir que o ficheiro de entrada é um ficheiro de 'patch' no formato unificado. O &kdiff3; irá então obter os nomes dos ficheiros originais do ficheiro de 'patch'. Pelo menos um dos dois ficheiros terá de estar disponível. O &kdiff3; irá então invocar o <command
>patch</command
> para criar de novo o segundo ficheiro. </para
><para
>In &konqueror; you can select a patch file and select <menuchoice
><guisubmenu
>Preview in</guisubmenu
><guimenuitem
>KDiff3Part</guimenuitem
></menuchoice
> from the contextmenu. Be aware that this won't work if none of the original files are available, and it is not reliable if the original file(s) have changed since the patch-file was generated. </para
><para
>When run as a part &kdiff3; only provides the a two file diff, a very small toolbar and menu. Merging or directory comparison are not supported. </para>
</sect1>
</chapter>

<chapter id="faq">
<title
>Perguntas e Respostas</title>
&reporting.bugs; &updating.documentation; <qandaset id="faqlist">

<qandaentry
><question
><para
>Why is it called &kdiff3;? </para
></question
><answer
><para
>Tools named <application
>KDiff</application
> and <application
>KDiff2</application
> (now called &kompare;) already exist. Also &kdiff3; should suggest that it can merge like the <command
>diff3</command
> tool in the Diff-Tool collection. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Why did I release it under <acronym
>GPL</acronym
>? </para
></question
><answer
><para
>I'm using <acronym
>GPL</acronym
> programs for a very long time now and learned very much by having a look at many of the sources. Hence this is my <quote
>Thank You</quote
> to all programmers that also did so or will do the same. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Faltam alguns botões e funções. O que é que se passa? </para
></question
><answer
><para
>You compiled from source but you probably didn't specify the correct &kde; prefix with <command
>configure</command
>. By default configure wants to install in <filename class="directory"
>/usr/local</filename
> but then &kde; can't find the user interface ressource file (&ie; <filename
>kdiff3ui.rc</filename
>). The <filename
>README</filename
> file contains more information about the correct prefix. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Muitas das vezes as linhas que são semelhantes mas não idênticas aparecem umas ao lado das outras mas noutros casos não. Porquê? </para
></question
><answer
><para
>Lines where only the amount of white space characters is different are treated as <quote
>equal</quote
>at first, while just one different non-white character causes the lines to be <quote
>different</quote
>. If similar lines appear next to each other, this actually is coincidence but this fortunately is often the case. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Porque é que todos os conflitos deverão ser resolvidos para que o resultado da gravação possa ser gravado? </para
></question
><answer
><para
>Para cada secção igual ou diferente, o editor na janela do resultado da junção recorda onde é que esta começa ou termina. Isto é necessário para que os conflitos possam ser resolvidos manualmente ao seleccionar simplesmente o botão da origem (A, B ou C). Esta informação é perdida durante a gravação como texto e corresponde a demasiado esforço criar um formato de ficheiro especial que suporte a gravação e a reposição de toda a informação necessária. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Why does the editor in the merge result window not have an <quote
>undo</quote
> function? </para
></question
><answer
><para
>Isso era demasiado difícil até agora. Você poderá sempre repor uma versão de uma origem (A, B ou C) se carregar no botão respectivo. Para uma edição extensa, recomenda-se a utilização de outro editor, de qualquer forma. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>When I removed some text, then suddenly <quote
>&lt;No src line&gt;</quote
> appeared and can't be deleted. What does that mean and how can one remove this? </para
></question
><answer
><para
>For each equal or different section the editor in the merge result window remembers where it begins or ends. <quote
>&lt;No src line&gt;</quote
> means that there is nothing left in a section, not even a new line character. This can happen either while merging automatically or by editing. This is no problem, since this hint won't appear in the saved file. If you want the orignal source back just select the section (click on the left summary column) and then click the source button with the needed contents (A/B or C). </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Porque é que o &kdiff3; não suporta o realce de sintaxe? </para
></question
><answer
><para
>O &kdiff3; já usa demasiadas cores para o realce das diferenças. Se suportasse o realce de sintaxe, tornar-se-ia confuso. Use outro editor para esse efeito. </para
></answer
></qandaentry>

<qandaentry
><question
><para
>Existe demasiada informação aqui, mas a sua dúvida ainda não foi respondida? </para
></question
><answer
><para
>Por favor envie ao autor a sua dúvida. Agradece-se qualquer comentário. </para
></answer
></qandaentry>

</qandaset>
</chapter>

<chapter id="credits">

<title
>Créditos e Licença</title>

<para
>&kdiff3; - Ferramenta de Comparação e Junção de Ficheiros e Pastas </para>
<para
>Program copyright 2002-2005 Joachim Eibl <email
>joachim.eibl@gmx.de</email
> </para>
<para
>Vieram várias ideias giras e relatórios de erros dos colegas do autor e de pessoas da Wild Wild Web. Muito obrigado! </para>

<para
>Documentação Copyright &copy; 2002-2005 Joachim Eibl <email
>joachim.eibl at gmx.de</email
> </para>

<para
>Tradução de Pedro Morais <email
>morais@kde.org</email
></para
> 
&underFDL; &underGPL; </chapter>

<appendix id="installation">
<title
>Instalação</title>

<sect1 id="getting-kdiff3">
<title
>Como obter o &kdiff3;</title>

<para
>Você poderá obter a última versão do &kdiff3; na sua página pessoal em <ulink url="http://kdiff3.sourceforge.net"
>http://kdiff3.sourceforge.net</ulink
>. </para
><para
>O &kdiff3; está também disponível para outras plataformas. Veja a página pessoal para mais detalhes. </para>


</sect1>

<sect1 id="requirements">
<title
>Requisitos</title>

<para
>In order to successfully use all features of &kdiff3;, you need &kde; 3.1 or greater. </para
><para
>For information about how to run &kdiff3; on other platforms without &kde; please see the <ulink url="http://kdiff3.sourceforge.net"
>homepage</ulink
>. </para
><para
>You can find a list of changes at <ulink url="http://kdiff3.sourceforge.net/ChangeLog"
>http://kdiff3.sourceforge.net/ChangeLog</ulink
> or in the <filename
>ChangeLog</filename
> file of the source package. </para>
</sect1>

<sect1 id="compilation">
<title
>Compilação e Instalação</title>
&install.compile.documentation; </sect1>
</appendix>

&documentation.index;
</book>

<!--
Local Variables:
mode: sgml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:

vim:tabstop=2:shiftwidth=2:expandtab
-->